Mono Class Library: System.Net.AuthenticationManager Overview | Members

System.Net.AuthenticationManager.PreAuthenticate Method

Attempts to obtain a System.Net.Authorization instance used to initiate client authentication. [Edit]

public static Authorization PreAuthenticate (WebRequest request, ICredentials credentials)

Parameters

request
A System.Net.WebRequest containing a request for access to a resource. [Edit]
credentials
The System.Net.ICredentials associated with request . [Edit]

Returns

A System.Net.Authorization instance if an authentication module can provide authentication information to be sent with request ; otherwise, null. If credentials is null, this method returns null. [Edit]

Exceptions

TypeReason
ArgumentNullExceptionrequest is null. [Edit]

Remarks

The AuthenticationManager.PreAuthenticate(WebRequest, ICredentials) method invokes the IAuthenticationModule.PreAuthenticate(WebRequest, ICredentials) method of each registered authentication module until one of the modules returns a System.Net.Authorization instance. Authentication modules are called in the order in which they were registered via the AuthenticationManager.Register(IAuthenticationModule) method.

Note: The System.Net.Authorization instance contains the information that will be sent by a client to initiate authentication instead of waiting for the server to request it. Authentication modules that support preauthentication allow clients to improve server efficiency by avoiding extra round trips caused by authentication challenges.

Note: If an authorization module supports preauthentication of requests, its IAuthenticationModule.CanPreAuthenticate property returns true. Note that preauthentication requires that an authentication of the client has already occurred. The information obtained from the initial authentication is used to provide the Authorization.Message that is sent to the server as an authentication header in request .

[Edit]

Requirements

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