AuthenticationManager.Authenticate(String, WebRequest, ICredentials) Metoda

Definicja

Przestroga

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

Wywołuje każdy zarejestrowany moduł uwierzytelniania, aby znaleźć pierwszy moduł, który może odpowiadać na żądanie uwierzytelniania.

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

Parametry

challenge
String

Wyzwanie zwrócone przez zasób internetowy.

request
WebRequest

Żądanie, które zainicjowało wyzwanie uwierzytelniania.

credentials
ICredentials

Poświadczenia skojarzone z tym żądaniem.

Zwraca

Wystąpienie Authorization klasy zawierające wynik próby autoryzacji. Jeśli nie ma modułu uwierzytelniania, który odpowiada na wyzwanie, ta metoda zwraca wartość null.

Atrybuty

Wyjątki

Tylko platformy .NET Core i .NET 5+: we wszystkich przypadkach.

challenge to null.

-lub-

request to null.

-lub-

credentials to null.

Uwagi

Metoda Authenticate wywołuje metodę IAuthenticationModule.Authenticate w każdym zarejestrowanym module uwierzytelniania, dopóki jeden z modułów nie odpowie na Authorization wystąpienie.

Zwrócone pierwsze Authorization wystąpienie jest używane do uwierzytelniania żądania. Jeśli moduł uwierzytelniania nie może uwierzytelnić żądania, Authenticate metoda zwraca nullwartość .

Moduły uwierzytelniania są wywoływane w kolejności, w której są zarejestrowane w elemecie AuthenticationManager.

Dotyczy