AuthenticationHttpContextExtensions.GetTokenAsync Méthode

Définition

Surcharges

GetTokenAsync(HttpContext, String)

Authentifie la demande à l’aide du schéma d’authentification par défaut et retourne la valeur du jeton. Le schéma d’authentification par défaut peut être configuré à l’aide de DefaultAuthenticateScheme.

GetTokenAsync(HttpContext, String, String)

Authentifie la demande à l’aide du schéma spécifié et retourne la valeur du jeton.

GetTokenAsync(HttpContext, String)

Authentifie la demande à l’aide du schéma d’authentification par défaut et retourne la valeur du jeton. Le schéma d’authentification par défaut peut être configuré à l’aide de DefaultAuthenticateScheme.

public:
[System::Runtime::CompilerServices::Extension]
 static System::Threading::Tasks::Task<System::String ^> ^ GetTokenAsync(Microsoft::AspNetCore::Http::HttpContext ^ context, System::String ^ tokenName);
public static System.Threading.Tasks.Task<string> GetTokenAsync (this Microsoft.AspNetCore.Http.HttpContext context, string tokenName);
public static System.Threading.Tasks.Task<string?> GetTokenAsync (this Microsoft.AspNetCore.Http.HttpContext context, string tokenName);
static member GetTokenAsync : Microsoft.AspNetCore.Http.HttpContext * string -> System.Threading.Tasks.Task<string>
<Extension()>
Public Function GetTokenAsync (context As HttpContext, tokenName As String) As Task(Of String)

Paramètres

context
HttpContext

Contexte HttpContext .

tokenName
String

Nom du jeton.

Retours

Valeur du jeton s’il est présent.

S’applique à

GetTokenAsync(HttpContext, String, String)

Authentifie la demande à l’aide du schéma spécifié et retourne la valeur du jeton.

public:
[System::Runtime::CompilerServices::Extension]
 static System::Threading::Tasks::Task<System::String ^> ^ GetTokenAsync(Microsoft::AspNetCore::Http::HttpContext ^ context, System::String ^ scheme, System::String ^ tokenName);
public static System.Threading.Tasks.Task<string> GetTokenAsync (this Microsoft.AspNetCore.Http.HttpContext context, string scheme, string tokenName);
public static System.Threading.Tasks.Task<string?> GetTokenAsync (this Microsoft.AspNetCore.Http.HttpContext context, string? scheme, string tokenName);
static member GetTokenAsync : Microsoft.AspNetCore.Http.HttpContext * string * string -> System.Threading.Tasks.Task<string>
<Extension()>
Public Function GetTokenAsync (context As HttpContext, scheme As String, tokenName As String) As Task(Of String)

Paramètres

context
HttpContext

Contexte HttpContext .

scheme
String

Nom du schéma d’authentification.

tokenName
String

Nom du jeton.

Retours

Valeur du jeton s’il est présent.

S’applique à