Compartilhar via


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

Definição

Cuidado

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

Chama cada módulo de autenticação registrado para localizar o primeiro módulo que pode responder à solicitação de autenticação.

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

O desafio retornado pelo recurso da Internet.

request
WebRequest

A solicitação que iniciou o desafio de autenticação.

credentials
ICredentials

As credenciais associadas a essa solicitação.

Retornos

Uma instância da classe Authorization que contém o resultado da tentativa de autorização. Se não houver nenhum módulo de autenticação para responder ao desafio, esse método retornará null.

Atributos

Exceções

Somente .NET Core e .NET 5+: Em todos os casos.

challenge é null.

- ou -

request é null.

- ou -

credentials é null.

Comentários

O Authenticate método chama o IAuthenticationModule.Authenticate método em cada módulo de autenticação registrado até que um dos módulos responda com uma Authorization instância.

A primeira Authorization instância retornada é usada para autenticar a solicitação. Se nenhum módulo de autenticação puder autenticar a solicitação, o Authenticate método retornará null.

Os módulos de autenticação são chamados na ordem em que são registrados com o AuthenticationManager.

Aplica-se a