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.

Namespace:  System.Net
Assembly:  System (in System.dll)

static member Authenticate : 
        challenge:string * 
        request:WebRequest * 
        credentials:ICredentials -> Authorization

Parameters

challenge
Type: System.String

The challenge returned by the Internet resource.

request
Type: System.Net.WebRequest

The WebRequest that initiated the authentication challenge.

credentials
Type: System.Net.ICredentials

The ICredentials associated with this request.

Return Value

Type: System.Net.Authorization
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).

ExceptionCondition
ArgumentNullException

challenge is a null reference (Nothing in Visual Basic).

-or-

request is a null reference (Nothing in Visual Basic).

-or-

credentials is a null reference (Nothing in Visual Basic).

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.

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft