AuthenticationManager.Authenticate(String, WebRequest, ICredentials) Metodo

Definizione

Attenzione

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

Chiama ciascun modulo di autenticazione registrato per individuare il primo modulo in grado di rispondere alla richiesta di autenticazione.

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

Parametri

challenge
String

La richiesta restituita dalla risorsa Internet.

request
WebRequest

Richiesta che ha avviato la richiesta di autenticazione.

credentials
ICredentials

Credenziali associate a questa richiesta.

Restituisce

Istanza della classe Authorization contenente il risultato del tentativo di autorizzazione. Se non è presente alcun modulo di autenticazione in grado di rispondere alla richiesta, il metodo restituirà null.

Attributi

Eccezioni

Solo .NET Core e .NET 5+: In tutti i casi.

challenge è null.

-oppure-

request è null.

-oppure-

credentials è null.

Commenti

Il Authenticate metodo chiama il IAuthenticationModule.Authenticate metodo in ogni modulo di autenticazione registrato fino a quando uno del modulo non risponde con un'istanza Authorization di .

La prima Authorization istanza restituita viene usata per autenticare la richiesta. Se nessun modulo di autenticazione può autenticare la richiesta, il Authenticate metodo restituisce null.

I moduli di autenticazione vengono chiamati nell'ordine in cui sono registrati con .AuthenticationManager

Si applica a