Dela via


PolicyEvaluator.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:
 virtual System::Threading::Tasks::Task<Microsoft::AspNetCore::Authentication::AuthenticateResult ^> ^ AuthenticateAsync(Microsoft::AspNetCore::Authorization::AuthorizationPolicy ^ policy, Microsoft::AspNetCore::Http::HttpContext ^ context);
public virtual 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>
override this.AuthenticateAsync : Microsoft.AspNetCore.Authorization.AuthorizationPolicy * Microsoft.AspNetCore.Http.HttpContext -> System.Threading.Tasks.Task<Microsoft.AspNetCore.Authentication.AuthenticateResult>
Public Overridable 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 failed to authenticate.

Implements

Applies to