Re: Why won't WindowsPrincipal show as IUSR_<machine> ?
From: Joe Kaplan \(MVP - ADSI\) (joseph.e.kaplan_at_removethis.accenture.com)
Date: 06/25/04
- Previous message: Odie: "Why doesn't WindowsPrincipal show as IUSR_<machine>?"
- In reply to: Odie: "Why won't WindowsPrincipal show as IUSR_<machine> ?"
- Next in thread: Odie: "Re: Why won't WindowsPrincipal show as IUSR_<machine> ?"
- Reply: Odie: "Re: Why won't WindowsPrincipal show as IUSR_<machine> ?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Fri, 25 Jun 2004 13:25:13 -0500
It will be IUSER_MACHINE if you leave anonymous turned on in IIS AND enable
impersonation in your web.config.
Joe K.
"Odie" <Odie@discussions.microsoft.com> wrote in message
news:0256388A-CFC3-4929-9D88-4AA8B0CE72BD@microsoft.com...
> 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: Odie: "Why doesn't WindowsPrincipal show as IUSR_<machine>?"
- In reply to: Odie: "Why won't WindowsPrincipal show as IUSR_<machine> ?"
- Next in thread: Odie: "Re: Why won't WindowsPrincipal show as IUSR_<machine> ?"
- Reply: Odie: "Re: Why won't WindowsPrincipal show as IUSR_<machine> ?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|
|