AuthorizationServiceExtensions.AuthorizeAsync Método
Definição
Importante
Algumas informações se referem a produtos de pré-lançamento que podem ser substancialmente modificados antes do lançamento. A Microsoft não oferece garantias, expressas ou implícitas, das informações aqui fornecidas.
Sobrecargas
AuthorizeAsync(IAuthorizationService, ClaimsPrincipal, AuthorizationPolicy) |
Verifica se um usuário atende a uma política de autorização específica em relação ao recurso especificado. |
AuthorizeAsync(IAuthorizationService, ClaimsPrincipal, String) |
Verifica se um usuário atende a uma política de autorização específica em relação ao recurso especificado. |
AuthorizeAsync(IAuthorizationService, ClaimsPrincipal, Object, AuthorizationPolicy) |
Verifica se um usuário atende a uma política de autorização específica em relação ao recurso especificado. |
AuthorizeAsync(IAuthorizationService, ClaimsPrincipal, Object, IAuthorizationRequirement) |
Verifica se um usuário atende a um requisito específico para o recurso especificado |
AuthorizeAsync(IAuthorizationService, ClaimsPrincipal, AuthorizationPolicy)
Verifica se um usuário atende a uma política de autorização específica em relação ao recurso especificado.
public:
[System::Runtime::CompilerServices::Extension]
static System::Threading::Tasks::Task<bool> ^ AuthorizeAsync(Microsoft::AspNetCore::Authorization::IAuthorizationService ^ service, System::Security::Claims::ClaimsPrincipal ^ user, Microsoft::AspNetCore::Authorization::AuthorizationPolicy ^ policy);
public:
[System::Runtime::CompilerServices::Extension]
static System::Threading::Tasks::Task<Microsoft::AspNetCore::Authorization::AuthorizationResult ^> ^ AuthorizeAsync(Microsoft::AspNetCore::Authorization::IAuthorizationService ^ service, System::Security::Claims::ClaimsPrincipal ^ user, Microsoft::AspNetCore::Authorization::AuthorizationPolicy ^ policy);
public static System.Threading.Tasks.Task<bool> AuthorizeAsync (this Microsoft.AspNetCore.Authorization.IAuthorizationService service, System.Security.Claims.ClaimsPrincipal user, Microsoft.AspNetCore.Authorization.AuthorizationPolicy policy);
public static System.Threading.Tasks.Task<Microsoft.AspNetCore.Authorization.AuthorizationResult> AuthorizeAsync (this Microsoft.AspNetCore.Authorization.IAuthorizationService service, System.Security.Claims.ClaimsPrincipal user, Microsoft.AspNetCore.Authorization.AuthorizationPolicy policy);
static member AuthorizeAsync : Microsoft.AspNetCore.Authorization.IAuthorizationService * System.Security.Claims.ClaimsPrincipal * Microsoft.AspNetCore.Authorization.AuthorizationPolicy -> System.Threading.Tasks.Task<bool>
static member AuthorizeAsync : Microsoft.AspNetCore.Authorization.IAuthorizationService * System.Security.Claims.ClaimsPrincipal * Microsoft.AspNetCore.Authorization.AuthorizationPolicy -> System.Threading.Tasks.Task<Microsoft.AspNetCore.Authorization.AuthorizationResult>
<Extension()>
Public Function AuthorizeAsync (service As IAuthorizationService, user As ClaimsPrincipal, policy As AuthorizationPolicy) As Task(Of Boolean)
<Extension()>
Public Function AuthorizeAsync (service As IAuthorizationService, user As ClaimsPrincipal, policy As AuthorizationPolicy) As Task(Of AuthorizationResult)
Parâmetros
- service
- IAuthorizationService
O IAuthorizationService fornecendo autorização.
- user
- ClaimsPrincipal
O usuário no qual avaliar a política.
- policy
- AuthorizationPolicy
A política a ser avaliada.
Retornos
Um sinalizador que indica se a avaliação da política foi bem-sucedida ou falhou.
Esse valor é true
quando o usuário atende à política, caso contrário, false
.
Aplica-se a
AuthorizeAsync(IAuthorizationService, ClaimsPrincipal, String)
Verifica se um usuário atende a uma política de autorização específica em relação ao recurso especificado.
public:
[System::Runtime::CompilerServices::Extension]
static System::Threading::Tasks::Task<bool> ^ AuthorizeAsync(Microsoft::AspNetCore::Authorization::IAuthorizationService ^ service, System::Security::Claims::ClaimsPrincipal ^ user, System::String ^ policyName);
public:
[System::Runtime::CompilerServices::Extension]
static System::Threading::Tasks::Task<Microsoft::AspNetCore::Authorization::AuthorizationResult ^> ^ AuthorizeAsync(Microsoft::AspNetCore::Authorization::IAuthorizationService ^ service, System::Security::Claims::ClaimsPrincipal ^ user, System::String ^ policyName);
public static System.Threading.Tasks.Task<bool> AuthorizeAsync (this Microsoft.AspNetCore.Authorization.IAuthorizationService service, System.Security.Claims.ClaimsPrincipal user, string policyName);
public static System.Threading.Tasks.Task<Microsoft.AspNetCore.Authorization.AuthorizationResult> AuthorizeAsync (this Microsoft.AspNetCore.Authorization.IAuthorizationService service, System.Security.Claims.ClaimsPrincipal user, string policyName);
static member AuthorizeAsync : Microsoft.AspNetCore.Authorization.IAuthorizationService * System.Security.Claims.ClaimsPrincipal * string -> System.Threading.Tasks.Task<bool>
static member AuthorizeAsync : Microsoft.AspNetCore.Authorization.IAuthorizationService * System.Security.Claims.ClaimsPrincipal * string -> System.Threading.Tasks.Task<Microsoft.AspNetCore.Authorization.AuthorizationResult>
<Extension()>
Public Function AuthorizeAsync (service As IAuthorizationService, user As ClaimsPrincipal, policyName As String) As Task(Of Boolean)
<Extension()>
Public Function AuthorizeAsync (service As IAuthorizationService, user As ClaimsPrincipal, policyName As String) As Task(Of AuthorizationResult)
Parâmetros
- service
- IAuthorizationService
O IAuthorizationService fornecendo autorização.
- user
- ClaimsPrincipal
O usuário no qual avaliar a política.
- policyName
- String
O nome da política a ser avaliada.
Retornos
Um sinalizador que indica se a avaliação da política foi bem-sucedida ou falhou.
Esse valor é true
quando o usuário atende à política, caso contrário, false
.
Aplica-se a
AuthorizeAsync(IAuthorizationService, ClaimsPrincipal, Object, AuthorizationPolicy)
Verifica se um usuário atende a uma política de autorização específica em relação ao recurso especificado.
public:
[System::Runtime::CompilerServices::Extension]
static System::Threading::Tasks::Task<bool> ^ AuthorizeAsync(Microsoft::AspNetCore::Authorization::IAuthorizationService ^ service, System::Security::Claims::ClaimsPrincipal ^ user, System::Object ^ resource, Microsoft::AspNetCore::Authorization::AuthorizationPolicy ^ policy);
public:
[System::Runtime::CompilerServices::Extension]
static System::Threading::Tasks::Task<Microsoft::AspNetCore::Authorization::AuthorizationResult ^> ^ AuthorizeAsync(Microsoft::AspNetCore::Authorization::IAuthorizationService ^ service, System::Security::Claims::ClaimsPrincipal ^ user, System::Object ^ resource, Microsoft::AspNetCore::Authorization::AuthorizationPolicy ^ policy);
public static System.Threading.Tasks.Task<bool> AuthorizeAsync (this Microsoft.AspNetCore.Authorization.IAuthorizationService service, System.Security.Claims.ClaimsPrincipal user, object resource, Microsoft.AspNetCore.Authorization.AuthorizationPolicy policy);
public static System.Threading.Tasks.Task<Microsoft.AspNetCore.Authorization.AuthorizationResult> AuthorizeAsync (this Microsoft.AspNetCore.Authorization.IAuthorizationService service, System.Security.Claims.ClaimsPrincipal user, object resource, Microsoft.AspNetCore.Authorization.AuthorizationPolicy policy);
public static System.Threading.Tasks.Task<Microsoft.AspNetCore.Authorization.AuthorizationResult> AuthorizeAsync (this Microsoft.AspNetCore.Authorization.IAuthorizationService service, System.Security.Claims.ClaimsPrincipal user, object? resource, Microsoft.AspNetCore.Authorization.AuthorizationPolicy policy);
static member AuthorizeAsync : Microsoft.AspNetCore.Authorization.IAuthorizationService * System.Security.Claims.ClaimsPrincipal * obj * Microsoft.AspNetCore.Authorization.AuthorizationPolicy -> System.Threading.Tasks.Task<bool>
static member AuthorizeAsync : Microsoft.AspNetCore.Authorization.IAuthorizationService * System.Security.Claims.ClaimsPrincipal * obj * Microsoft.AspNetCore.Authorization.AuthorizationPolicy -> System.Threading.Tasks.Task<Microsoft.AspNetCore.Authorization.AuthorizationResult>
<Extension()>
Public Function AuthorizeAsync (service As IAuthorizationService, user As ClaimsPrincipal, resource As Object, policy As AuthorizationPolicy) As Task(Of Boolean)
<Extension()>
Public Function AuthorizeAsync (service As IAuthorizationService, user As ClaimsPrincipal, resource As Object, policy As AuthorizationPolicy) As Task(Of AuthorizationResult)
Parâmetros
- service
- IAuthorizationService
O IAuthorizationService fornecendo autorização.
- user
- ClaimsPrincipal
O usuário no qual avaliar a política.
- resource
- Object
O recurso no qual avaliar a política.
- policy
- AuthorizationPolicy
A política a ser avaliada.
Retornos
Um sinalizador que indica se a avaliação da política foi bem-sucedida ou falhou.
Esse valor é true
quando o usuário atende à política, caso contrário, false
.
Aplica-se a
AuthorizeAsync(IAuthorizationService, ClaimsPrincipal, Object, IAuthorizationRequirement)
Verifica se um usuário atende a um requisito específico para o recurso especificado
public:
[System::Runtime::CompilerServices::Extension]
static System::Threading::Tasks::Task<bool> ^ AuthorizeAsync(Microsoft::AspNetCore::Authorization::IAuthorizationService ^ service, System::Security::Claims::ClaimsPrincipal ^ user, System::Object ^ resource, Microsoft::AspNetCore::Authorization::IAuthorizationRequirement ^ requirement);
public:
[System::Runtime::CompilerServices::Extension]
static System::Threading::Tasks::Task<Microsoft::AspNetCore::Authorization::AuthorizationResult ^> ^ AuthorizeAsync(Microsoft::AspNetCore::Authorization::IAuthorizationService ^ service, System::Security::Claims::ClaimsPrincipal ^ user, System::Object ^ resource, Microsoft::AspNetCore::Authorization::IAuthorizationRequirement ^ requirement);
public static System.Threading.Tasks.Task<bool> AuthorizeAsync (this Microsoft.AspNetCore.Authorization.IAuthorizationService service, System.Security.Claims.ClaimsPrincipal user, object resource, Microsoft.AspNetCore.Authorization.IAuthorizationRequirement requirement);
public static System.Threading.Tasks.Task<Microsoft.AspNetCore.Authorization.AuthorizationResult> AuthorizeAsync (this Microsoft.AspNetCore.Authorization.IAuthorizationService service, System.Security.Claims.ClaimsPrincipal user, object resource, Microsoft.AspNetCore.Authorization.IAuthorizationRequirement requirement);
public static System.Threading.Tasks.Task<Microsoft.AspNetCore.Authorization.AuthorizationResult> AuthorizeAsync (this Microsoft.AspNetCore.Authorization.IAuthorizationService service, System.Security.Claims.ClaimsPrincipal user, object? resource, Microsoft.AspNetCore.Authorization.IAuthorizationRequirement requirement);
static member AuthorizeAsync : Microsoft.AspNetCore.Authorization.IAuthorizationService * System.Security.Claims.ClaimsPrincipal * obj * Microsoft.AspNetCore.Authorization.IAuthorizationRequirement -> System.Threading.Tasks.Task<bool>
static member AuthorizeAsync : Microsoft.AspNetCore.Authorization.IAuthorizationService * System.Security.Claims.ClaimsPrincipal * obj * Microsoft.AspNetCore.Authorization.IAuthorizationRequirement -> System.Threading.Tasks.Task<Microsoft.AspNetCore.Authorization.AuthorizationResult>
<Extension()>
Public Function AuthorizeAsync (service As IAuthorizationService, user As ClaimsPrincipal, resource As Object, requirement As IAuthorizationRequirement) As Task(Of Boolean)
<Extension()>
Public Function AuthorizeAsync (service As IAuthorizationService, user As ClaimsPrincipal, resource As Object, requirement As IAuthorizationRequirement) As Task(Of AuthorizationResult)
Parâmetros
- service
- IAuthorizationService
O IAuthorizationService fornecendo autorização.
- user
- ClaimsPrincipal
O usuário no qual avaliar a política.
- resource
- Object
O recurso no qual avaliar a política.
- requirement
- IAuthorizationRequirement
O requisito para avaliar a política.
Retornos
Um sinalizador que indica se a avaliação do requisito foi bem-sucedida ou falhou.
Esse valor é true
quando o usuário atende à política, caso contrário, false
.