共用方式為


AuthenticationTokenExtensions.GetTokenAsync 方法

定義

多載

GetTokenAsync(AuthenticationManager, String)
GetTokenAsync(IAuthenticationService, HttpContext, String)

使用指定的驗證配置驗證要求,並傳回權杖的值。

GetTokenAsync(AuthenticationManager, String, String)
GetTokenAsync(IAuthenticationService, HttpContext, String, String)

使用指定的驗證配置驗證要求,並傳回權杖的值。

GetTokenAsync(AuthenticationManager, String)

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

參數

tokenName
String

傳回

適用於

GetTokenAsync(IAuthenticationService, HttpContext, String)

來源:
TokenExtensions.cs
來源:
TokenExtensions.cs
來源:
TokenExtensions.cs

使用指定的驗證配置驗證要求,並傳回權杖的值。

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

參數

context
HttpContext

內容 HttpContext

tokenName
String

權杖的名稱。

傳回

如果存在,則為權杖的值。

適用於

GetTokenAsync(AuthenticationManager, String, String)

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

參數

signInScheme
String
tokenName
String

傳回

適用於

GetTokenAsync(IAuthenticationService, HttpContext, String, String)

來源:
TokenExtensions.cs
來源:
TokenExtensions.cs
來源:
TokenExtensions.cs

使用指定的驗證配置驗證要求,並傳回權杖的值。

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

參數

context
HttpContext

內容 HttpContext

scheme
String

驗證配置的名稱。

tokenName
String

權杖的名稱。

傳回

如果存在,則為權杖的值。

適用於