共用方式為


IPolicyEvaluator.AuthenticateAsync(AuthorizationPolicy, HttpContext) 方法

定義

對 進行驗證 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)

參數

傳回

Success(AuthenticationTicket) 除非 指定 AuthenticationSchemes 的所有配置都無法進行驗證。

適用於