Why won't WindowsPrincipal show as IUSR_<machine> ?
From: Odie (Odie_at_discussions.microsoft.com)
Date: 06/25/04
- Previous message: jains: "Re: security"
- Next in thread: Joe Kaplan \(MVP - ADSI\): "Re: Why won't WindowsPrincipal show as IUSR_<machine> ?"
- Reply: Joe Kaplan \(MVP - ADSI\): "Re: Why won't WindowsPrincipal show as IUSR_<machine> ?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Fri, 25 Jun 2004 08:47:51 -0700
I have a test harness set up to explore some .Net security stuff.
I have an .aspx page w/ .cs code-behind that gets the current Windows identity of the asp.net thread:
-=-=
WindowsIdentity MyIdentity = WindowsIdentity.GetCurrent();
WindowsPrincipal MyPrincipal = new WindowsPrincipal(MyIdentity);
string Name = MyPrincipal.Identity.Name;
string Type = MyPrincipal.Identity.AuthenticationType;
string Auth = MyPrincipal.Identity.IsAuthenticated.ToString();
//Identity values.
string IdentName = MyIdentity.Name;
string IdentType = MyIdentity.AuthenticationType;
string IdentIsAuth = MyIdentity.IsAuthenticated.ToString();
string ISAnon = MyIdentity.IsAnonymous.ToString();
-=-=
When I have IIS Security set to [anon + integrated security], my test page printed out:
Principal Name: MYMACHINE\ASPNET
Principal Type: NTLM
Principal IsAuthenticated: True
Identity IsAnonymous: False
Identity IsGuest: False
Identity IsSystem: False
This is good.
But when I removed integrated security from IIS Security tab my test page still prints out exactly the same thing! Then I remembered asp.net has it's own stuff in web.config, so I changed:
<authentication mode="Windows" />
to
<authentication mode="None" />
I still get exactly the same output from my test page! Just in case there's some weird caching going on here, I shut down my web server and ran IISRESET - still to no avail.
I can sort of understand the PrincipalName=ASPNET (even though I would expect it to be IUSR_MYMACHINE). But I don't understand why it insists on having IsAuthenticated=True and IsAnonymous=False.
??
- Previous message: jains: "Re: security"
- Next in thread: Joe Kaplan \(MVP - ADSI\): "Re: Why won't WindowsPrincipal show as IUSR_<machine> ?"
- Reply: Joe Kaplan \(MVP - ADSI\): "Re: Why won't WindowsPrincipal show as IUSR_<machine> ?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|
|