This documentation is archived and is not being maintained.

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
public static Authorization Authenticate(
 string challenge,
 WebRequest request,
 ICredentials credentials
public: static Authorization* Authenticate(
 String* challenge,
 WebRequest* request,
 ICredentials* credentials
public static function Authenticate(
   challenge : String,
 request : WebRequest,
 credentials : ICredentials
) : Authorization;


The challenge returned by the Internet resource.
The WebRequest that initiated the authentication challenge.
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).


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


request is a null reference (Nothing).


credentials is a null reference (Nothing).


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.


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