System.Web.Security.WindowsAuthenticationModule Class

Sets the identity of the user for an ASP.NET application when Windows authentication is enabled. This class cannot be inherited.

See Also: WindowsAuthenticationModule Members


public sealed class WindowsAuthenticationModule : System.Web.IHttpModule


When the authentication System.Web.Configuration.AuthenticationSection.Mode is set to System.Web.Configuration.AuthenticationMode.Windows, the System.Web.Security.WindowsAuthenticationModule sets the System.Web.HttpContext.User property of the current System.Web.HttpContext to an System.Security.Principal.IPrincipal object that represents the Windows identity supplied by IIS for the current request. If IIS uses anonymous authentication, then the System.Web.Security.WindowsAuthenticationModule uses the identity returned by the System.Security.Principal.WindowsIdentity.GetAnonymous method.

The System.Web.Security.WindowsAuthenticationModule exposes an WindowsAuthenticationModule.Authenticate event that enables you to provide a custom System.Security.Principal.IPrincipal object for the System.Web.HttpContext.User property of the current System.Web.HttpContext. The WindowsAuthenticationModule.Authenticate event is accessed by specifying a subroutine named WindowsAuthentication_OnAuthenticate in the Global.asax file for your ASP.NET application.


In IIS 7.0, using the System.Web.Security.WindowsAuthenticationModule class with the System.Web.Security.FormsAuthenticationModule class is not supported. For more information about compatibility issues in Integrated mode, see Moving an ASP.NET Application from IIS 6.0 to IIS 7.0.


Namespace: System.Web.Security
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 1.0.5000.0,