System.Web.Security.FormsAuthenticationModule.Authenticate Event

Occurs when the application authenticates the current request.

Syntax

public event FormsAuthenticationEventHandler Authenticate

Remarks

The FormsAuthenticationModule.Authenticate event is raised during the System.Web.HttpApplication.AuthenticateRequest event.

You can handle the FormsAuthenticationModule.Authenticate event of the System.Web.Security.FormsAuthenticationModule class by specifying a subroutine named FormsAuthentication_OnAuthenticate in the Global.asax file for your ASP.NET application.

You can use the System.Web.Security.FormsAuthenticationEventArgs FormsAuthenticationEventArgs.User property supplied to the FormsAuthentication_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 FormsAuthenticationEventArgs.User property during the FormsAuthentication_OnAuthenticate event, the identity supplied by the forms authentication ticket in the cookie or URL is used.

The FormsAuthentication_OnAuthenticate event is only raised when the authentication mode is set to System.Web.Configuration.AuthenticationMode.Forms in the authentication element of the application's configuration file and the System.Web.Security.FormsAuthenticationModule is an active HTTP module for the application.

Requirements

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