Export (0) Print
Expand All

AuthenticatingEventArgs Class

Provides data for the Authenticating event.

System.Object
  System.EventArgs
    System.Web.ApplicationServices.AuthenticatingEventArgs

Namespace:  System.Web.ApplicationServices
Assembly:  System.Web.Extensions (in System.Web.Extensions.dll)

type AuthenticatingEventArgs =  
    class 
        inherit EventArgs 
    end

The AuthenticatingEventArgs type exposes the following members.

  NameDescription
Public propertyAuthenticatedGets or sets a value that indicates whether the user credentials are valid.
Public propertyAuthenticationIsCompleteGets or sets a value that indicates whether the user credentials have been authenticated.
Public propertyCustomCredentialGets additional user values for authentication.
Public propertyPasswordGets the password for the user.
Public propertyUserNameGets the authentication name for the user.
Top

  NameDescription
Public methodEquals(Object)Determines whether the specified object is equal to the current object. (Inherited from Object.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetHashCodeServes as the default hash function. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Top

You create a handler for the Authenticating event when you want to customize how the user's credentials are authenticated at run time. The AuthenticatingEventArgs class supplies values to any Authenticating event handler. By using the properties available in this class, you can retrieve the user credentials to customize authentication.

The AuthenticationService class raises the Authenticating event before validating the user credentials. The AuthenticationService class constructs an instance of the AuthenticatingEventArgs object and passes it to any Authenticating event handler.

You can use the UserName, Password and CustomCredential properties to retrieve the user credentials. The CustomCredential property can contain additional values that are required for authentication, such as an identification number.

The Authenticated property indicates whether the user credentials are valid. You set the Authenticated property to the result of your customized authentication. In addition, you set the AuthenticationIsComplete property to true if you have checked the user credentials and do not want the AuthenticationService class to check user credentials through the default membership provider.

The following example shows an event handler that passes the UserName and Password values to a custom membership provider to validate the user credentials. The event handler sets Authenticated to the return value of the ValidateUser method and sets AuthenticationIsComplete to true so that the AuthenticationService class does not validate the credentials.

No code example is currently available or this language may not be supported.

.NET Framework

Supported in: 4.5, 4, 3.5

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Show:
© 2014 Microsoft