This should explain it:
http://msdn.microsoft.com/en-us/library/aa302377.aspx
The following tables illustrate, for a range of IIS authentication settings, the resultant identity that is obtained from each of the variables that maintain an IPrincipal and/or IIdentity object. The following abbreviations are used in the table:
- HttpContext = HttpContext.Current.User, which returns an IPrincipal object that contains security information for the current Web request. This is the authenticated Web client.
- WindowsIdentity = WindowsIdentity.GetCurrent(), which returns the identity of the security context of the currently executing Win32 thread.
- Thread = Thread.CurrentPrincipal which returns the principal of the currently executing .NET thread which rides on top of the Win32 thread.
Note With IIS 6.0 running on Windows Server 2003, the identity Matrix works except that the Machine\ASPNET identity is replaced with NT Authority\Network Service.
Table 1. IIS anonymous authentication
| Web.config Settings |
Variable Location |
Resultant Identity |
<identity impersonate="true"/> <authentication mode="Windows" /> |
HttpContext WindowsIdentity Thread |
- MACHINE\IUSR_MACHINE - |
<identity impersonate="false"/> <authentication mode="Windows" /> |
HttpContext WindowsIdentity Thread |
- MACHINE\ASPNET -
|
<identity impersonate="true"/> <authentication mode="Forms" /> |
HttpContext WindowsIdentity Thread |
Name provided by user MACHINE\IUSR_MACHINE Name provided by user
|
<identity impersonate="false"/> <authentication mode="Forms" /> |
HttpContext WindowsIdentity Thread |
Name provided by user MACHINE\ASPNET Name provided by user |
Table 2. IIS basic authentication
| Web.config Settings |
Variable Location |
Resultant Identity |
<identity impersonate="true"/> <authentication mode="Windows" /> |
HttpContext WindowsIdentity Thread |
Domain\UserName Domain\UserName Domain\UserName |
<identity impersonate="false"/> <authentication mode="Windows" /> |
HttpContext WindowsIdentity Thread |
Domain\UserName MACHINE\ASPNET Domain\UserName |
<identity impersonate="true"/> <authentication mode="Forms" /> |
HttpContext WindowsIdentity Thread |
Name provided by user Domain\UserName Name provided by user |
<identity impersonate="false"/> <authentication mode="Forms" /> |
HttpContext WindowsIdentity Thread |
Name provided by user MACHINE\ASPNET Name provided by user |
Table 3. IIS digest authentication
| Web.config Settings |
Variable Location |
Resultant Identity |
<identity impersonate="true"/> <authentication mode="Windows" /> |
HttpContext WindowsIdentity Thread |
Domain\UserName Domain\UserName Domain\UserName |
<identity impersonate="false"/> <authentication mode="Windows" /> |
HttpContext WindowsIdentity Thread |
Domain\UserName MACHINE\ASPNET Domain\UserName |
<identity impersonate="true"/> <authentication mode="Forms" /> |
HttpContext WindowsIdentity Thread |
Name provided by user Domain\UserName Name provided by user |
<identity impersonate="false"/> <authentication mode="Forms" /> |
HttpContext WindowsIdentity Thread |
Name provided by user MACHINE\ASPNET Name provided by user |
Table 4: IIS integrated Windows
| Web.config Settings |
Variable Location |
Resultant Identity |
<identity impersonate="true"/> <authentication mode="Windows" /> |
HttpContext WindowsIdentity Thread |
Domain\UserName Domain\UserName Domain\UserName |
<identity impersonate="false"/> <authentication mode="Windows" /> |
HttpContext WindowsIdentity Thread |
Domain\UserName MACHINE\ASPNET Domain\UserName |
<identity impersonate="true"/> <authentication mode="Forms" /> |
HttpContext WindowsIdentity Thread |
Name provided by user Domain\UserName Name provided by user |
<identity impersonate="false"/> <authentication mode="Forms" /> |
HttpContext. WindowsIdentity Thread |
Name provided by user MACHINE\ASPNET Name provided by user |