System.Web.Security.FormsAuthenticationEventArgs Class

Provides data for the FormsAuthentication_OnAuthenticate event. This class cannot be inherited.

See Also: FormsAuthenticationEventArgs Members


public sealed class FormsAuthenticationEventArgs : EventArgs


The System.Web.Security.FormsAuthenticationEventArgs class is used to supply event values to the FormsAuthentication_OnAuthenticate event and to enable you to specify a custom identity for the current request.

The System.Web.Security.FormsAuthenticationModule constructs a System.Web.Security.FormsAuthenticationEventArgs object using the current System.Web.HttpContext and passes it to the FormsAuthentication_OnAuthenticate event.

You can use the FormsAuthenticationEventArgs.User property 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 System.Web.Configuration.AuthenticationSection.Mode is set to System.Web.Configuration.AuthenticationMode.Forms and the System.Web.Security.FormsAuthenticationModule is an active HTTP module for the application.


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