System.Net.AuthenticationManager.Authenticate Method

Calls each registered authentication module to find the first module that can respond to the authentication request.

Syntax

public static Authorization Authenticate (string challenge, WebRequest request, ICredentials credentials)

Parameters

challenge
The challenge returned by the Internet resource.
request
The System.Net.WebRequest that initiated the authentication challenge.
credentials
The System.Net.ICredentials associated with this request.

Returns

An instance of the System.Net.Authorization class containing the result of the authorization attempt. If there is no authentication module to respond to the challenge, this method returns null.

Exceptions

TypeReason
ArgumentNullException challenge , request , or credentials is null.

Remarks

The AuthenticationManager.Authenticate(string, WebRequest, ICredentials) method calls the IAuthenticationModule.Authenticate(string, WebRequest, ICredentials) method on each registered authentication module until one of the module responds with an System.Net.Authorization instance.

The first System.Net.Authorization instance returned is used to authenticate the request. If no authentication module can authenticate the request, the AuthenticationManager.Authenticate(string, WebRequest, ICredentials) method returns null.

Authentication modules are called in the order in which they are registered with the System.Net.AuthenticationManager.

Requirements

Namespace: System.Net
Assembly: System (in System.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0