AuthenticationManager.PreAuthenticate(WebRequest, ICredentials) Methode

Definitie

Let op

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

Een aanvraag voorafauthenticeert.

public:
 static System::Net::Authorization ^ PreAuthenticate(System::Net::WebRequest ^ request, System::Net::ICredentials ^ credentials);
public static System.Net.Authorization? PreAuthenticate(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? PreAuthenticate(System.Net.WebRequest request, System.Net.ICredentials credentials);
public static System.Net.Authorization PreAuthenticate(System.Net.WebRequest request, System.Net.ICredentials credentials);
static member PreAuthenticate : 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 PreAuthenticate : System.Net.WebRequest * System.Net.ICredentials -> System.Net.Authorization
Public Shared Function PreAuthenticate (request As WebRequest, credentials As ICredentials) As Authorization

Parameters

request
WebRequest

Een aanvraag voor een internetresource.

credentials
ICredentials

De referenties die zijn gekoppeld aan de aanvraag.

Retouren

Een exemplaar van de Authorization klasse als de aanvraag vooraf kan worden geverifieerd; nullanders. Als credentials dat het is null, retourneert nulldeze methode .

Kenmerken

Uitzonderingen

.NET Core en .NET 5+ alleen: in alle gevallen.

request is null.

Opmerkingen

Als de verificatiemodule de aanvraag vooraf kan verifiëren, retourneert de PreAuthenticate methode een verificatie-exemplaar en worden de autorisatiegegevens naar de server verzonden in plaats van te wachten tot de resource een uitdaging uitgeeft. Dit gedrag wordt beschreven in sectie 3.3 van RFC 2617 (HTTP-verificatie: basis- en digesttoegangsverificatie). Met verificatiemodules die ondersteuning bieden voor verificatie vooraf, kunnen clients de serverefficiëntie verbeteren door extra retouren te voorkomen die worden veroorzaakt door verificatieproblemen.

Autorisatiemodules die aanvragen vooraf kunnen verifiëren, stellen de IAuthenticationModule.CanPreAuthenticate eigenschap in op true.

Van toepassing op