Sdílet prostřednictvím


AuthorizationServiceExtensions.AuthorizeAsync Metoda

Definice

Přetížení

AuthorizeAsync(IAuthorizationService, ClaimsPrincipal, AuthorizationPolicy)

Zkontroluje, jestli uživatel splňuje konkrétní zásady autorizace pro zadaný prostředek.

AuthorizeAsync(IAuthorizationService, ClaimsPrincipal, String)

Zkontroluje, jestli uživatel splňuje konkrétní zásady autorizace pro zadaný prostředek.

AuthorizeAsync(IAuthorizationService, ClaimsPrincipal, Object, AuthorizationPolicy)

Zkontroluje, jestli uživatel splňuje konkrétní zásady autorizace pro zadaný prostředek.

AuthorizeAsync(IAuthorizationService, ClaimsPrincipal, Object, IAuthorizationRequirement)

Zkontroluje, jestli uživatel splňuje konkrétní požadavek pro zadaný prostředek.

AuthorizeAsync(IAuthorizationService, ClaimsPrincipal, AuthorizationPolicy)

Zdroj:
AuthorizationServiceExtensions.cs
Zdroj:
AuthorizationServiceExtensions.cs
Zdroj:
AuthorizationServiceExtensions.cs
Zdroj:
AuthorizationServiceExtensions.cs
Zdroj:
AuthorizationServiceExtensions.cs
Zdroj:
AuthorizationServiceExtensions.cs
Zdroj:
AuthorizationServiceExtensions.cs
Zdroj:
AuthorizationServiceExtensions.cs
Zdroj:
AuthorizationServiceExtensions.cs

Zkontroluje, jestli uživatel splňuje konkrétní zásady autorizace pro zadaný prostředek.

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)

Parametry

service
IAuthorizationService

IAuthorizationService poskytující autorizaci.

user
ClaimsPrincipal

Uživatel, který má zásadu vyhodnotit.

policy
AuthorizationPolicy

Zásady, které se mají vyhodnotit.

Návraty

Příznak označující, jestli bylo vyhodnocení zásad úspěšné nebo neúspěšné. Tato hodnota je true, když uživatel splní zásady, jinak false.

Platí pro

AuthorizeAsync(IAuthorizationService, ClaimsPrincipal, String)

Zdroj:
AuthorizationServiceExtensions.cs
Zdroj:
AuthorizationServiceExtensions.cs
Zdroj:
AuthorizationServiceExtensions.cs
Zdroj:
AuthorizationServiceExtensions.cs
Zdroj:
AuthorizationServiceExtensions.cs
Zdroj:
AuthorizationServiceExtensions.cs
Zdroj:
AuthorizationServiceExtensions.cs
Zdroj:
AuthorizationServiceExtensions.cs
Zdroj:
AuthorizationServiceExtensions.cs

Zkontroluje, jestli uživatel splňuje konkrétní zásady autorizace pro zadaný prostředek.

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)

Parametry

service
IAuthorizationService

IAuthorizationService poskytující autorizaci.

user
ClaimsPrincipal

Uživatel, který má zásadu vyhodnotit.

policyName
String

Název zásady, která se má vyhodnotit.

Návraty

Příznak označující, jestli bylo vyhodnocení zásad úspěšné nebo neúspěšné. Tato hodnota je true, když uživatel splní zásady, jinak false.

Platí pro

AuthorizeAsync(IAuthorizationService, ClaimsPrincipal, Object, AuthorizationPolicy)

Zdroj:
AuthorizationServiceExtensions.cs
Zdroj:
AuthorizationServiceExtensions.cs
Zdroj:
AuthorizationServiceExtensions.cs
Zdroj:
AuthorizationServiceExtensions.cs
Zdroj:
AuthorizationServiceExtensions.cs
Zdroj:
AuthorizationServiceExtensions.cs
Zdroj:
AuthorizationServiceExtensions.cs
Zdroj:
AuthorizationServiceExtensions.cs
Zdroj:
AuthorizationServiceExtensions.cs

Zkontroluje, jestli uživatel splňuje konkrétní zásady autorizace pro zadaný prostředek.

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)

Parametry

service
IAuthorizationService

IAuthorizationService poskytující autorizaci.

user
ClaimsPrincipal

Uživatel, který má zásadu vyhodnotit.

resource
Object

Prostředek k vyhodnocení zásady.

policy
AuthorizationPolicy

Zásady, které se mají vyhodnotit.

Návraty

Příznak označující, jestli bylo vyhodnocení zásad úspěšné nebo neúspěšné. Tato hodnota je true, když uživatel splní zásady, jinak false.

Platí pro

AuthorizeAsync(IAuthorizationService, ClaimsPrincipal, Object, IAuthorizationRequirement)

Zdroj:
AuthorizationServiceExtensions.cs
Zdroj:
AuthorizationServiceExtensions.cs
Zdroj:
AuthorizationServiceExtensions.cs
Zdroj:
AuthorizationServiceExtensions.cs
Zdroj:
AuthorizationServiceExtensions.cs
Zdroj:
AuthorizationServiceExtensions.cs
Zdroj:
AuthorizationServiceExtensions.cs
Zdroj:
AuthorizationServiceExtensions.cs
Zdroj:
AuthorizationServiceExtensions.cs

Zkontroluje, jestli uživatel splňuje konkrétní požadavek pro zadaný prostředek.

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)

Parametry

service
IAuthorizationService

IAuthorizationService poskytující autorizaci.

user
ClaimsPrincipal

Uživatel, který má zásadu vyhodnotit.

resource
Object

Prostředek k vyhodnocení zásady.

requirement
IAuthorizationRequirement

Požadavek na vyhodnocení zásad.

Návraty

Příznak označující, jestli bylo vyhodnocení požadavku úspěšné nebo neúspěšné. Tato hodnota je true, když uživatel splní zásady, jinak false.

Platí pro