28.12.2013 Views

Building Secure ASP.NET Applications - People Search Directory

Building Secure ASP.NET Applications - People Search Directory

Building Secure ASP.NET Applications - People Search Directory

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>ASP</strong>.<strong>NET</strong> Identity Matrix<br />

Principal objects implement the IPrincipal interface and represent the security<br />

context of the user on whose behalf the code is running. The principal object<br />

includes the user’s identity (as a contained IIdentity object) and any roles to which<br />

the user belongs.<br />

<strong>ASP</strong>.<strong>NET</strong> provides the following principal and identity object implementations:<br />

● WindowsPrincipal and WindowsIdentity objects represent users who have been<br />

authenticated with Windows authentication. With these objects, the role list is<br />

automatically obtained from the set of Windows groups to which the Windows<br />

user belongs.<br />

● GenericPrincipal and GenericIdentity objects represent users who have been<br />

authenticated using Forms authentication or other custom authentication<br />

mechanisms. With these objects, the role list is obtained in a custom manner,<br />

typically from a database.<br />

● FormsIdentity and PassportIdentity objects represent users who have been<br />

authenticated with Forms and Passport authentication respectively.<br />

The following tables illustrate, for a range of IIS authentication settings, the<br />

resultant identity that is obtained from each of the variables that maintain an<br />

IPrincipal and/or IIdentity object. The following abbreviations are used in<br />

the table:<br />

● HttpContext = HttpContext.Current.User, which returns an IPrincipal object<br />

that contains security information for the current Web request. This is the<br />

authenticated Web client.<br />

● WindowsIdentity = WindowsIdentity.GetCurrent(), which returns the identity<br />

of the security context of the currently executing Win32 thread.<br />

● Thread = Thread.CurrentPrincipal which returns the principal of the currently<br />

executing .<strong>NET</strong> thread which rides on top of the Win32 thread.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!