AuthenticationManager.Authenticate(String, WebRequest, ICredentials) Metoda

Definice

Upozornění

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

Zavolá každý zaregistrovaný ověřovací modul a vyhledá první modul, který může reagovat na žádost o ověření.

public:
 static System::Net::Authorization ^ Authenticate(System::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}")]
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);
static member Authenticate : string * System.Net.WebRequest * System.Net.ICredentials -> System.Net.Authorization
[<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
Public Shared Function Authenticate (challenge As String, request As WebRequest, credentials As ICredentials) As Authorization

Parametry

challenge
String

Výzva vrácená internetovým prostředkem

request
WebRequest

Požadavek, který inicioval ověřovací výzvu.

credentials
ICredentials

Přihlašovací údaje přidružené k tomuto požadavku.

Návraty

Instance Authorization třídy obsahující výsledek pokusu o autorizaci. Pokud neexistuje žádný ověřovací modul pro reakci na výzvu, tato metoda vrátí null.

Atributy

Výjimky

Pouze .NET Core a .NET 5+ : Ve všech případech.

challenge je null.

nebo

request je null.

nebo

credentials je null.

Poznámky

Metoda Authenticate volá metodu IAuthenticationModule.Authenticate pro každý zaregistrovaný ověřovací modul, dokud jeden z modulů neodpovědí s Authorization instancí.

Authorization První vrácená instance se používá k ověření požadavku. Pokud žádný ověřovací modul nemůže požadavek ověřit, Authenticate vrátí nullmetoda .

Ověřovací moduly se volají v pořadí, v jakém jsou registrovány v AuthenticationManager.

Platí pro