Represents the method that handles the WindowsAuthentication_OnAuthenticate event of a System.Web.Security.WindowsAuthenticationModule.
- sender
- Documentation for this section has not yet been entered.
- e
- Documentation for this section has not yet been entered.
The System.Web.Security.WindowsAuthenticationEventHandler delegate is defined for the WindowsAuthenticationModule.Authenticate event of the System.Web.Security.WindowsAuthenticationModule class. You can access the WindowsAuthenticationModule.Authenticate event of the System.Web.Security.WindowsAuthenticationModule class by specifying a subroutine named WindowsAuthentication_OnAuthenticate in the Global.asax file for your ASP.NET application. The WindowsAuthenticationModule.Authenticate event is raised during the System.Web.HttpApplication.AuthenticateRequest event.
The System.Web.Security.WindowsAuthenticationModule constructs a System.Web.Security.WindowsAuthenticationEventArgs object using the Windows identity supplied by IIS and the current System.Web.HttpContext and passes it to the WindowsAuthentication_OnAuthenticate event.
You can use the WindowsAuthenticationEventArgs.User property of the System.Web.Security.WindowsAuthenticationEventArgs object supplied to the WindowsAuthentication_OnAuthenticate event to set the System.Web.HttpContext.User property of the current System.Web.HttpContext to a custom System.Security.Principal.IPrincipal object. If you do not specify a value for the WindowsAuthenticationEventArgs.User property during the WindowsAuthentication_OnAuthenticate event, the Windows identity supplied by IIS is used as the identity for the current request. If IIS uses anonymous authentication, then the WindowsAuthenticationEventArgs.Identity property of the System.Web.Security.WindowsAuthenticationEventArgs object is set to the identity returned by the System.Security.Principal.WindowsIdentity.GetAnonymous method.
The WindowsAuthentication_OnAuthenticate event is only raised when the authentication System.Web.Configuration.AuthenticationSection.Mode is set to System.Web.Configuration.AuthenticationMode.Windows and the System.Web.Security.WindowsAuthenticationModule is an active HTTP module for the application.