Export (0) Print
Expand All

IAuthenticationModule.Authenticate Method

Returns an instance of the Authorization class in respose to an authentication challenge from a server.

Namespace:  System.Net
Assembly:  System (in System.dll)

abstract Authenticate : 
        challenge:string * 
        request:WebRequest * 
        credentials:ICredentials -> Authorization


Type: System.String

The authentication challenge sent by the server.

Type: System.Net.WebRequest

The WebRequest instance associated with the challenge.

Type: System.Net.ICredentials

The credentials associated with the challenge.

Return Value

Type: System.Net.Authorization
An Authorization instance containing the authorization message for the request, or a null reference (Nothing in Visual Basic) if the challenge cannot be handled.

The Authenticate method conducts the authentication process with the server and returns an Authorization instance to the AuthenticationManager.

Notes to Implementers

The AuthenticationManager calls the Authenticate method on registered authentication modules to determine which module handles the challenge. If the authentication module cannot handle the challenge, the Authenticate method must return a null reference (Nothing in Visual Basic). If the authentication module encounters an error while conducting the authentication process, Authenticate must throw an exception.

The following example shows how to use the Authenticate method. For a complete example refer to the AuthenticationManager class.

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

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
© 2015 Microsoft