PolicyEvaluator.AuthenticateAsync(AuthorizationPolicy, HttpContext) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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
- policy
- AuthorizationPolicy
The AuthorizationPolicy.
- context
- HttpContext
The HttpContext.
Returns
Success(AuthenticationTicket) unless all schemes specified by AuthenticationSchemes failed to authenticate.