System.Web.Security.WindowsAuthenticationEventArgs Class

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

See Also: WindowsAuthenticationEventArgs Members

Syntax

public sealed class WindowsAuthenticationEventArgs : EventArgs

Remarks

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

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 is set to the identity returned by the System.Security.Principal.WindowsIdentity.GetAnonymous method.

The WindowsAuthentication_OnAuthenticate event is raised only 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.

Requirements

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