Groups | Blog | Home
all groups > asp.net security > june 2006 >

asp.net security : Mixing Forms and Windows Securiey


Jerry C
6/26/2006 1:03:01 PM
This is a new post covering two previous posts:

"Unable to establish secure connection to Server" and "membership and
redirect of unauthenticated user"

Thank you for your replys.

I found a MSDN Library entry by the Title of:
"Mixing Forms and Windows Security in ASP.NET" by Paul wilson January 2004

I have tried this code and it seems to sort of work except for several
problems.
First it is in C# and I am having trouble transferring it into VB.
In the line: "this.Request.Cookies[Global.ReturnUrl] == Null" when I change
it to vb "request.cookies(Global.ReturnUrl) is nothing" the Global.ReturnURl
does not work. This may be that the code was written in a old version of
dotnet and I am trying to use it in VS2005. The converter removed the code
behind from the Global.aspx.

The other problem is when a non windows user access the winlogin page a
login popup shows but when I cancel it the correct WebLogin page shows. how
can I get rid of the popup up



--
lukezhan NO[at]SPAM online.microsoft.com
6/27/2006 12:00:00 AM
Hello Jerry,

In VS.NET 2003, there is class defined in Global.asax, so that we can use
Global.ReturnUrl to access a static member of the class. In In VS.NET 2005,
there is no such class defined in Global.asax. To get around this, we can
simply use a static or hardcode string instead.

For question 2, can you check in the IIS security setting, did you use
windows integrated authentication or Basic authentication?

Regards,

Luke Zhang
Microsoft Online Community Lead

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

(This posting is provided "AS IS", with no warranties, and confers no
rights.)
Jerry C
6/27/2006 8:56:02 AM
Luke,
Thanks for your reply. Did you find the code for this article?

I don’t think I need to fix the Global problem since I am using Membership
and forms auth. That will redirect the user to the defaultUrl.

I still am having the popup login box for the user with no credentials they
should be redirected to the weblogin form without the popup. I can get it to
work correctly by setting IE tools.internet options. Security. Local
intranet.custom level.settings to anonymous login. I would like this to work
for all settings. If the user needs to set up the browser I could just a
easly tell them to use differet pages one for users with accounts and one
without.

I wonder is there is a article that addresses this problem using VS2005,
forms auth and membership.

Thanks

--
Jerry


[quoted text, click to view]
lukezhan NO[at]SPAM online.microsoft.com
6/28/2006 12:00:00 AM
Hello Jerry,

Yes, I have downloaded the code and tested it on my side:

public class Global : System.Web.HttpApplication
{
public const string ReturnUrl = "MixedSecurity.ReturnUrl";

"Global.ReturnUrl" is actually a static string "MixedSecurity.ReturnUrl".

Regarding the question about login box, I found this is pop up before our
ASP.NET application is touched. The login box is raised by IE in
conversation between IE and IIS. When a file (WinLogin.aspx in this case)
was set with integrated authentication, it will require client IE send
windows authenticated token. If it didn't found the toke, it will return an
error to IE and IE will pop up the login box for user account input. We
cannot control this from server side. The only way is set anonymous login
in client IE as you mentioned, or we can tell user to click Cancel button
if they don't have a valid windows account.

Regards,

Luke Zhang
Microsoft Online Community Lead

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

(This posting is provided "AS IS", with no warranties, and confers no
rights.)
AddThis Social Bookmark Button