AuthenticationTokenExtensions.GetTokenAsync 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
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)
参数
- manager
- AuthenticationManager
- tokenName
- String
返回
适用于
GetTokenAsync(IAuthenticationService, HttpContext, String)
- Source:
- TokenExtensions.cs
- Source:
- TokenExtensions.cs
- Source:
- 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)
参数
- manager
- AuthenticationManager
- signInScheme
- String
- tokenName
- String
返回
适用于
GetTokenAsync(IAuthenticationService, HttpContext, String, String)
- Source:
- TokenExtensions.cs
- Source:
- TokenExtensions.cs
- Source:
- 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
令牌的名称。
返回
令牌的值(如果存在)。