AuthenticationManager.Authenticate(String, WebRequest, ICredentials) Método

Definición

Precaución

The AuthenticationManager Authenticate and PreAuthenticate methods are not supported and throw PlatformNotSupportedException.

Llama a cada uno de los módulos de autenticación registrados para encontrar el primer módulo que pueda responder a la solicitud de autenticación.

public:
 static System::Net::Authorization ^ Authenticate(System::String ^ challenge, System::Net::WebRequest ^ request, System::Net::ICredentials ^ credentials);
[System.Obsolete("The AuthenticationManager Authenticate and PreAuthenticate methods are not supported and throw PlatformNotSupportedException.", DiagnosticId="SYSLIB0009", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public static System.Net.Authorization? Authenticate (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);
public static System.Net.Authorization Authenticate (string challenge, System.Net.WebRequest request, System.Net.ICredentials credentials);
[<System.Obsolete("The AuthenticationManager Authenticate and PreAuthenticate methods are not supported and throw PlatformNotSupportedException.", DiagnosticId="SYSLIB0009", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
static member Authenticate : string * System.Net.WebRequest * System.Net.ICredentials -> System.Net.Authorization
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

Parámetros

challenge
String

Desafío devuelto por el recurso de Internet.

request
WebRequest

Solicitud que inició el desafío de autenticación.

credentials
ICredentials

Las credenciales asociadas a esta solicitud.

Devoluciones

Instancia de la clase Authorization que contiene el resultado del intento de autorización. Si no hay ningún módulo de autenticación que responda al desafío, el método devuelve null.

Atributos

Excepciones

.NET Core y .NET 5+ solo: En todos los casos.

challenge es null.

o bien

request es null.

O bien

credentials es null.

Comentarios

El Authenticate método llama al IAuthenticationModule.Authenticate método en cada módulo de autenticación registrado hasta que uno de los módulos responde con una Authorization instancia.

La primera Authorization instancia devuelta se usa para autenticar la solicitud. Si ningún módulo de autenticación puede autenticar la solicitud, el Authenticate método devuelve null.

Se llama a los módulos de autenticación en el orden en que se registran con .AuthenticationManager

Se aplica a