IAuthenticationModule.Authenticate Method (String, WebRequest, ICredentials)


The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

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 null 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 null. 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
Available since 1.1
Return to top