AuthenticationManager.Authenticate(String, WebRequest, ICredentials) Method

Definition

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

public:
 static System::Net::Authorization ^ Authenticate(System::String ^ challenge, System::Net::WebRequest ^ request, System::Net::ICredentials ^ credentials);
public static System.Net.Authorization Authenticate (string challenge, System.Net.WebRequest request, System.Net.ICredentials credentials);
static member Authenticate : string * System.Net.WebRequest * System.Net.ICredentials -> System.Net.Authorization
Public Shared Function Authenticate (challenge As String, request As WebRequest, credentials As ICredentials) As Authorization

Parameters

challenge
String

The challenge returned by the Internet resource.

request
WebRequest

The WebRequest that initiated the authentication challenge.

credentials
ICredentials

The ICredentials associated with this request.

Returns

An instance of the 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

challenge is null.

-or-

request is null.

-or-

credentials is null.

Remarks

The Authenticate method calls the IAuthenticationModule.Authenticate method on each registered authentication module until one of the module responds with an Authorization instance.

The first Authorization instance returned is used to authenticate the request. If no authentication module can authenticate the request, the Authenticate method returns null.

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

Applies to