Team LiB
Previous Section Next Section

ASP.NET Identity Matrix

Overview

Principal objects implement the IPrincipal interface and represent the security context of the user on whose behalf the code is running. The principal object includes the user’s identity (as a contained IIdentity object) and any roles to which the user belongs.

ASP.NET provides the following principal and identity object implementations:

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:

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\UserNameDomain\UserNameDomain\UserName
<identity impersonate=”false”/> <authentication mode=”Windows” />

HttpContext

WindowsIdentity

Thread

Domain\UserNameMACHINE\ASPNETDomain\UserName
<identity impersonate=”true”/> <authentication mode=”Forms” />

HttpContext

WindowsIdentity

Thread

Name provided by userDomain\UserNameName provided by user
<identity impersonate=”false”/> <authentication mode=”Forms” />

HttpContext

WindowsIdentity

Thread

Name provided by user MACHINE\ASPNET Name provided by user

Team LiB
Previous Section Next Section