AuthorizationServiceExtensions.AuthorizeAsync Metodo
Definizione
Importante
Alcune informazioni sono relative alla release non definitiva del prodotto, che potrebbe subire modifiche significative prima della release definitiva. Microsoft non riconosce alcuna garanzia, espressa o implicita, in merito alle informazioni qui fornite.
Overload
AuthorizeAsync(IAuthorizationService, ClaimsPrincipal, AuthorizationPolicy) |
Controlla se un utente soddisfa criteri di autorizzazione specifici rispetto alla risorsa specificata. |
AuthorizeAsync(IAuthorizationService, ClaimsPrincipal, String) |
Controlla se un utente soddisfa criteri di autorizzazione specifici rispetto alla risorsa specificata. |
AuthorizeAsync(IAuthorizationService, ClaimsPrincipal, Object, AuthorizationPolicy) |
Controlla se un utente soddisfa criteri di autorizzazione specifici rispetto alla risorsa specificata. |
AuthorizeAsync(IAuthorizationService, ClaimsPrincipal, Object, IAuthorizationRequirement) |
Controlla se un utente soddisfa un requisito specifico per la risorsa specificata |
AuthorizeAsync(IAuthorizationService, ClaimsPrincipal, AuthorizationPolicy)
Controlla se un utente soddisfa criteri di autorizzazione specifici rispetto alla risorsa specificata.
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)
Parametri
- service
- IAuthorizationService
Il IAuthorizationService che fornisce l'autorizzazione.
- user
- ClaimsPrincipal
L'utente a cui valutare i criteri.
- policy
- AuthorizationPolicy
Criteri da valutare.
Restituisce
Flag che indica se la valutazione dei criteri ha avuto esito positivo o negativo.
Questo valore è true
quando l'utente soddisfa i criteri; in caso contrario, false
.
Si applica a
AuthorizeAsync(IAuthorizationService, ClaimsPrincipal, String)
Controlla se un utente soddisfa criteri di autorizzazione specifici rispetto alla risorsa specificata.
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)
Parametri
- service
- IAuthorizationService
Il IAuthorizationService che fornisce l'autorizzazione.
- user
- ClaimsPrincipal
L'utente a cui valutare i criteri.
- policyName
- String
Nome del criterio da valutare.
Restituisce
Flag che indica se la valutazione dei criteri ha avuto esito positivo o negativo.
Questo valore è true
quando l'utente soddisfa i criteri; in caso contrario, false
.
Si applica a
AuthorizeAsync(IAuthorizationService, ClaimsPrincipal, Object, AuthorizationPolicy)
Controlla se un utente soddisfa criteri di autorizzazione specifici rispetto alla risorsa specificata.
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)
Parametri
- service
- IAuthorizationService
Il IAuthorizationService che fornisce l'autorizzazione.
- user
- ClaimsPrincipal
L'utente a cui valutare i criteri.
- resource
- Object
Risorsa in base alla quale valutare i criteri.
- policy
- AuthorizationPolicy
Criteri da valutare.
Restituisce
Flag che indica se la valutazione dei criteri ha avuto esito positivo o negativo.
Questo valore è true
quando l'utente soddisfa i criteri; in caso contrario, false
.
Si applica a
AuthorizeAsync(IAuthorizationService, ClaimsPrincipal, Object, IAuthorizationRequirement)
Controlla se un utente soddisfa un requisito specifico per la risorsa specificata
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)
Parametri
- service
- IAuthorizationService
Il IAuthorizationService che fornisce l'autorizzazione.
- user
- ClaimsPrincipal
L'utente a cui valutare i criteri.
- resource
- Object
Risorsa in base alla quale valutare i criteri.
- requirement
- IAuthorizationRequirement
Requisito di valutare i criteri rispetto a .
Restituisce
Flag che indica se la valutazione dei requisiti ha avuto esito positivo o negativo.
Questo valore è true
quando l'utente soddisfa i criteri; in caso contrario, false
.