Why won't WindowsPrincipal show as IUSR_<machine> ?

From: Odie (Odie_at_discussions.microsoft.com)
Date: 06/25/04

  • Next message: Odie: "Why doesn't WindowsPrincipal show as IUSR_<machine>?"
    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.

    ??


  • Next message: Odie: "Why doesn't WindowsPrincipal show as IUSR_<machine>?"

    Relevant Pages

    • Is Malware Hiding in Your Windows Registry?
      ... Security experts have found a vulnerability in the Windows operating ... According to a security advisory by Denmark-based IT security company ... Editor Utility's handling of long string names. ...
      (comp.dcom.telecom)
    • Re: why use the sealed ?
      ... system that supports inheritance and polymorphism is to promote reusability. ... Find great Windows Forms articles in Windows Forms Tips and Tricks ... >> exceeds past the end of the string. ... >> application to be a Remoting Client. ...
      (microsoft.public.dotnet.languages.csharp)
    • Re: XP and string paths
      ... > the "Lcase" function is suddenly no longer available to Excel? ... > that occurs because of Windows XP. ... > string functions that Excel uses has become ... > is the usual "missing reference" problem. ...
      (microsoft.public.excel.programming)
    • Re: Windows versus Application Security
      ... Public Property UserNameAs String ... What is the equivalent in a Windows Application? ... So you would just have a login entry from that check the user likely from ... managing and removing windows domain accounts are not the ...
      (microsoft.public.dotnet.framework.windowsforms)
    • Re: problem logging off and shutting down
      ... One using the Windows OS CD ... using repar from the setup menu and another microsoft repair tool that I ran ... I have been all over the Microsoft website and internet trying to ... #1 is a String Value ...
      (microsoft.public.windowsxp.general)