IPolicyEvaluator.AuthenticateAsync(AuthorizationPolicy, HttpContext) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
對 進行驗證 AuthenticationSchemes ,並將產生的 ClaimsPrincipal 設定為 User 。 如果未設定配置,則這是無作業。
public:
System::Threading::Tasks::Task<Microsoft::AspNetCore::Authentication::AuthenticateResult ^> ^ AuthenticateAsync(Microsoft::AspNetCore::Authorization::AuthorizationPolicy ^ policy, Microsoft::AspNetCore::Http::HttpContext ^ context);
public System.Threading.Tasks.Task<Microsoft.AspNetCore.Authentication.AuthenticateResult> AuthenticateAsync (Microsoft.AspNetCore.Authorization.AuthorizationPolicy policy, Microsoft.AspNetCore.Http.HttpContext context);
abstract member AuthenticateAsync : Microsoft.AspNetCore.Authorization.AuthorizationPolicy * Microsoft.AspNetCore.Http.HttpContext -> System.Threading.Tasks.Task<Microsoft.AspNetCore.Authentication.AuthenticateResult>
Public Function AuthenticateAsync (policy As AuthorizationPolicy, context As HttpContext) As Task(Of AuthenticateResult)
參數
- context
- HttpContext
傳回
Success(AuthenticationTicket) 除非 指定 AuthenticationSchemes 的所有配置都無法進行驗證。