Compartilhar via


DefaultAuthorizationService.AuthorizeAsync Método

Definição

Sobrecargas

AuthorizeAsync(ClaimsPrincipal, Object, IEnumerable<IAuthorizationRequirement>)

Verifica se um usuário atende a um conjunto específico de requisitos para o recurso especificado.

AuthorizeAsync(ClaimsPrincipal, Object, String)

Verifica se um usuário atende a uma política de autorização específica.

AuthorizeAsync(ClaimsPrincipal, Object, IEnumerable<IAuthorizationRequirement>)

Origem:
DefaultAuthorizationService.cs
Origem:
DefaultAuthorizationService.cs
Origem:
DefaultAuthorizationService.cs
Origem:
DefaultAuthorizationService.cs
Origem:
DefaultAuthorizationService.cs
Origem:
DefaultAuthorizationService.cs
Origem:
DefaultAuthorizationService.cs
Origem:
DefaultAuthorizationService.cs
Origem:
DefaultAuthorizationService.cs

Verifica se um usuário atende a um conjunto específico de requisitos para o recurso especificado.

public:
 virtual System::Threading::Tasks::Task<bool> ^ AuthorizeAsync(System::Security::Claims::ClaimsPrincipal ^ user, System::Object ^ resource, System::Collections::Generic::IEnumerable<Microsoft::AspNetCore::Authorization::IAuthorizationRequirement ^> ^ requirements);
public:
 virtual System::Threading::Tasks::Task<Microsoft::AspNetCore::Authorization::AuthorizationResult ^> ^ AuthorizeAsync(System::Security::Claims::ClaimsPrincipal ^ user, System::Object ^ resource, System::Collections::Generic::IEnumerable<Microsoft::AspNetCore::Authorization::IAuthorizationRequirement ^> ^ requirements);
public System.Threading.Tasks.Task<bool> AuthorizeAsync (System.Security.Claims.ClaimsPrincipal user, object resource, System.Collections.Generic.IEnumerable<Microsoft.AspNetCore.Authorization.IAuthorizationRequirement> requirements);
public System.Threading.Tasks.Task<Microsoft.AspNetCore.Authorization.AuthorizationResult> AuthorizeAsync (System.Security.Claims.ClaimsPrincipal user, object resource, System.Collections.Generic.IEnumerable<Microsoft.AspNetCore.Authorization.IAuthorizationRequirement> requirements);
public virtual System.Threading.Tasks.Task<Microsoft.AspNetCore.Authorization.AuthorizationResult> AuthorizeAsync (System.Security.Claims.ClaimsPrincipal user, object? resource, System.Collections.Generic.IEnumerable<Microsoft.AspNetCore.Authorization.IAuthorizationRequirement> requirements);
abstract member AuthorizeAsync : System.Security.Claims.ClaimsPrincipal * obj * seq<Microsoft.AspNetCore.Authorization.IAuthorizationRequirement> -> System.Threading.Tasks.Task<bool>
override this.AuthorizeAsync : System.Security.Claims.ClaimsPrincipal * obj * seq<Microsoft.AspNetCore.Authorization.IAuthorizationRequirement> -> System.Threading.Tasks.Task<bool>
abstract member AuthorizeAsync : System.Security.Claims.ClaimsPrincipal * obj * seq<Microsoft.AspNetCore.Authorization.IAuthorizationRequirement> -> System.Threading.Tasks.Task<Microsoft.AspNetCore.Authorization.AuthorizationResult>
override this.AuthorizeAsync : System.Security.Claims.ClaimsPrincipal * obj * seq<Microsoft.AspNetCore.Authorization.IAuthorizationRequirement> -> System.Threading.Tasks.Task<Microsoft.AspNetCore.Authorization.AuthorizationResult>
Public Function AuthorizeAsync (user As ClaimsPrincipal, resource As Object, requirements As IEnumerable(Of IAuthorizationRequirement)) As Task(Of Boolean)
Public Function AuthorizeAsync (user As ClaimsPrincipal, resource As Object, requirements As IEnumerable(Of IAuthorizationRequirement)) As Task(Of AuthorizationResult)
Public Overridable Function AuthorizeAsync (user As ClaimsPrincipal, resource As Object, requirements As IEnumerable(Of IAuthorizationRequirement)) As Task(Of AuthorizationResult)

Parâmetros

user
ClaimsPrincipal

O usuário com o qual avaliar os requisitos.

resource
Object

O recurso no qual avaliar os requisitos.

requirements
IEnumerable<IAuthorizationRequirement>

Os requisitos a serem avaliados.

Retornos

Um sinalizador que indica se a autorização foi bem-sucedida. Esse valor é true quando o usuário atende à política, caso contrário, false.

Implementações

Aplica-se a

AuthorizeAsync(ClaimsPrincipal, Object, String)

Origem:
DefaultAuthorizationService.cs
Origem:
DefaultAuthorizationService.cs
Origem:
DefaultAuthorizationService.cs
Origem:
DefaultAuthorizationService.cs
Origem:
DefaultAuthorizationService.cs
Origem:
DefaultAuthorizationService.cs
Origem:
DefaultAuthorizationService.cs
Origem:
DefaultAuthorizationService.cs
Origem:
DefaultAuthorizationService.cs

Verifica se um usuário atende a uma política de autorização específica.

public:
 virtual System::Threading::Tasks::Task<bool> ^ AuthorizeAsync(System::Security::Claims::ClaimsPrincipal ^ user, System::Object ^ resource, System::String ^ policyName);
public:
 virtual System::Threading::Tasks::Task<Microsoft::AspNetCore::Authorization::AuthorizationResult ^> ^ AuthorizeAsync(System::Security::Claims::ClaimsPrincipal ^ user, System::Object ^ resource, System::String ^ policyName);
public System.Threading.Tasks.Task<bool> AuthorizeAsync (System.Security.Claims.ClaimsPrincipal user, object resource, string policyName);
public System.Threading.Tasks.Task<Microsoft.AspNetCore.Authorization.AuthorizationResult> AuthorizeAsync (System.Security.Claims.ClaimsPrincipal user, object resource, string policyName);
public virtual System.Threading.Tasks.Task<Microsoft.AspNetCore.Authorization.AuthorizationResult> AuthorizeAsync (System.Security.Claims.ClaimsPrincipal user, object? resource, string policyName);
abstract member AuthorizeAsync : System.Security.Claims.ClaimsPrincipal * obj * string -> System.Threading.Tasks.Task<bool>
override this.AuthorizeAsync : System.Security.Claims.ClaimsPrincipal * obj * string -> System.Threading.Tasks.Task<bool>
abstract member AuthorizeAsync : System.Security.Claims.ClaimsPrincipal * obj * string -> System.Threading.Tasks.Task<Microsoft.AspNetCore.Authorization.AuthorizationResult>
override this.AuthorizeAsync : System.Security.Claims.ClaimsPrincipal * obj * string -> System.Threading.Tasks.Task<Microsoft.AspNetCore.Authorization.AuthorizationResult>
Public Function AuthorizeAsync (user As ClaimsPrincipal, resource As Object, policyName As String) As Task(Of Boolean)
Public Function AuthorizeAsync (user As ClaimsPrincipal, resource As Object, policyName As String) As Task(Of AuthorizationResult)
Public Overridable Function AuthorizeAsync (user As ClaimsPrincipal, resource As Object, policyName As String) As Task(Of AuthorizationResult)

Parâmetros

user
ClaimsPrincipal

O usuário com o qual verificar a política.

resource
Object

O recurso com o qual a política deve ser verificada.

policyName
String

O nome da política a ser verificada em relação a um contexto específico.

Retornos

Um sinalizador que indica se a autorização foi bem-sucedida. Esse valor é true quando o usuário atende à política de outra forma false.

Implementações

Aplica-se a