| |||||||
DefaultAuthenticationEventArgs ConstructorSystem.Web.Security Namespace DefaultAuthenticationEventArgs Class Initializes a new instance of the DefaultAuthenticationEventArgs class. [ VB ] Public Sub New ( _ context As HttpContext _ ) [ C# ] public DefaultAuthenticationEventArgs ( HttpContext context ); [ C++ ] public: DefaultAuthenticationEventArgs ( HttpContext* context ); [ JScript ] public function DefaultAuthenticationEventArgs ( context : HttpContext ); Parameters
RemarksThe DefaultAuthenticationModule object constructs a DefaultAuthenticationEventArgs object using the current HttpContext and passes it to the DefaultAuthentication_OnAuthenticate event. You can use the Context property of the DefaultAuthenticationEventArgs object supplied to the DefaultAuthentication_OnAuthenticate event to set the User property of the current HttpContext to a custom IPrincipal object. If you do not specify a value for the User property of the HttpContext referenced by the Context property, the DefaultAuthenticationModule sets the User property of the HttpContext to a GenericPrincipal object that contains no user information. The DefaultAuthentication_OnAuthenticate event is raised after the AuthenticateRequest event and before the AuthorizeRequest event. If you have an authorization section that depends on the user name to deny or allow access to your application, modifying the User property of the current HttpContext can affect the behavior of your application. Be sure that the user name you set during the DefaultAuthentication_OnAuthenticate event is considered when you specify the authorization section in your configuration. ExampleThe following code example uses the DefaultAuthentication_OnAuthenticate event to test whether the User property of the current HttpContext is a null reference ( Nothing in Visual Basic ) . If the property is a null reference ( Nothing in Visual Basic ), the example sets the User property of the current HttpContext to a GenericPrincipal object where the Identity property of the GenericPrincipal object is a GenericIdentity object with a Name property value of "default".
See AlsoDefaultAuthenticationEventArgs Members |
| ||||||
Check out related books at Amazon
© 2000-2008 Rey Nuñez All rights reserved.
If you have any question, comment or suggestion
about this site, please send us a note
You can help support aspxtreme