Export (0) Print
Expand All

AuthenticationManager.Authenticate Method

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

[Visual Basic]
Public Shared Function Authenticate( _
   ByVal challenge As String, _
   ByVal request As WebRequest, _
   ByVal credentials As ICredentials _
) As Authorization
[C#]
public static Authorization Authenticate(
 string challenge,
 WebRequest request,
 ICredentials credentials
);
[C++]
public: static Authorization* Authenticate(
 String* challenge,
 WebRequest* request,
 ICredentials* credentials
);
[JScript]
public static function Authenticate(
   challenge : String,
 request : WebRequest,
 credentials : ICredentials
) : Authorization;

Parameters

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

Return Value

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 a null reference (Nothing in Visual Basic).

Exceptions

Exception Type Condition
ArgumentNullException challenge is a null reference (Nothing in Visual Basic).

-or-

request is a null reference (Nothing).

-or-

credentials is a null reference (Nothing).

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 a null reference (Nothing in Visual Basic).

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

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework, Common Language Infrastructure (CLI) Standard

See Also

AuthenticationManager Class | AuthenticationManager Members | System.Net Namespace

Show:
© 2014 Microsoft