Share via


AuthenticationHttpContextExtensions.GetTokenAsync Method

Definition

Overloads

GetTokenAsync(HttpContext, String)

Authenticates the request using the default authentication scheme and returns the value for the token. The default authentication scheme can be configured using DefaultAuthenticateScheme.

GetTokenAsync(HttpContext, String, String)

Authenticates the request using the specified scheme and returns the value for the token.

GetTokenAsync(HttpContext, String)

Source:
AuthenticationHttpContextExtensions.cs
Source:
AuthenticationHttpContextExtensions.cs
Source:
AuthenticationHttpContextExtensions.cs

Authenticates the request using the default authentication scheme and returns the value for the token. The default authentication scheme can be configured using 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)

Parameters

context
HttpContext

The HttpContext context.

tokenName
String

The name of the token.

Returns

The value of the token if present.

Applies to

GetTokenAsync(HttpContext, String, String)

Source:
AuthenticationHttpContextExtensions.cs
Source:
AuthenticationHttpContextExtensions.cs
Source:
AuthenticationHttpContextExtensions.cs

Authenticates the request using the specified scheme and returns the value for the token.

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)

Parameters

context
HttpContext

The HttpContext context.

scheme
String

The name of the authentication scheme.

tokenName
String

The name of the token.

Returns

The value of the token if present.

Applies to