
548
|
Chapter 29: The System.Web.Security Namespace
This is the Title of the Book, eMatter Edition
Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved.
WindowsAuthenticationModule
System.Web.Security (system.web.dll)
sealed class
This module, when loaded through the web.config file (<authentication mode="Windows">),
provides Windows/IIS authentication. In this model, IIS authenticates the user iden-
tity for the current web request using any supported method (including Basic, Digest,
or Integrated Windows), and then passes that account to the ASP.NET application,
which it uses to access the resources it needs. The WindowsAuthenticationModule uses a System.
Security.Principal.WindowsIdentity object to hold user information received from IIS and
constructs a System.Security.Principal.WindowsPrincipal object to provide information about
group memberships. The System.Security.Principal.WindowsPrincipal object is attached to the
application context and provided through the System.Web.HttpContext.User property. This
module also provides a single event, Authenticate, which you can access through the
WindowsAuthentication_OnAuthenticate event handler in the global.asax file.
This type of authentication scheme is particularly useful in corporate intranet
scenarios, where IIS can be set to Integrated Windows authentication and all users can
access the application under their network accounts.