Dela via


IPolicyEvaluator.AuthenticateAsync(AuthorizationPolicy, HttpContext) Method

Definition

Does authentication for AuthenticationSchemes and sets the resulting ClaimsPrincipal to User. If no schemes are set, this is a no-op.

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)

Parameters

context
HttpContext

The HttpContext.

Returns

Success(AuthenticationTicket) unless all schemes specified by AuthenticationSchemes fail to authenticate.

Applies to