IPolicyEvaluator.AuthorizeAsync Método
Definición
Importante
Parte de la información hace referencia a la versión preliminar del producto, que puede haberse modificado sustancialmente antes de lanzar la versión definitiva. Microsoft no otorga ninguna garantía, explícita o implícita, con respecto a la información proporcionada aquí.
Intenta la autorización de una directiva mediante IAuthorizationService.
public:
System::Threading::Tasks::Task<Microsoft::AspNetCore::Authorization::Policy::PolicyAuthorizationResult ^> ^ AuthorizeAsync(Microsoft::AspNetCore::Authorization::AuthorizationPolicy ^ policy, Microsoft::AspNetCore::Authentication::AuthenticateResult ^ authenticationResult, Microsoft::AspNetCore::Http::HttpContext ^ context, System::Object ^ resource);
public System.Threading.Tasks.Task<Microsoft.AspNetCore.Authorization.Policy.PolicyAuthorizationResult> AuthorizeAsync (Microsoft.AspNetCore.Authorization.AuthorizationPolicy policy, Microsoft.AspNetCore.Authentication.AuthenticateResult authenticationResult, Microsoft.AspNetCore.Http.HttpContext context, object resource);
public System.Threading.Tasks.Task<Microsoft.AspNetCore.Authorization.Policy.PolicyAuthorizationResult> AuthorizeAsync (Microsoft.AspNetCore.Authorization.AuthorizationPolicy policy, Microsoft.AspNetCore.Authentication.AuthenticateResult authenticationResult, Microsoft.AspNetCore.Http.HttpContext context, object? resource);
abstract member AuthorizeAsync : Microsoft.AspNetCore.Authorization.AuthorizationPolicy * Microsoft.AspNetCore.Authentication.AuthenticateResult * Microsoft.AspNetCore.Http.HttpContext * obj -> System.Threading.Tasks.Task<Microsoft.AspNetCore.Authorization.Policy.PolicyAuthorizationResult>
Public Function AuthorizeAsync (policy As AuthorizationPolicy, authenticationResult As AuthenticateResult, context As HttpContext, resource As Object) As Task(Of PolicyAuthorizationResult)
Parámetros
- authenticationResult
- AuthenticateResult
Resultado de una llamada a AuthenticateAsync(AuthorizationPolicy, HttpContext).
- context
- HttpContext
- resource
- Object
Un recurso opcional con el que debe comprobarse la directiva. Si no se requiere un recurso para la evaluación de directivas, puede pasar null como valor.
Devoluciones
Devuelve Success() si la autorización se realiza correctamente. De lo contrario, devuelve Forbid(AuthorizationFailure) si Succeededdevuelve ; de lo contrario, devuelve . Challenge()