Поделиться через


AuthorizationServiceExtensions.AuthorizeAsync Метод

Определение

Перегрузки

AuthorizeAsync(IAuthorizationService, ClaimsPrincipal, AuthorizationPolicy)

Проверяет, соответствует ли пользователь определенной политике авторизации для указанного ресурса.

AuthorizeAsync(IAuthorizationService, ClaimsPrincipal, String)

Проверяет, соответствует ли пользователь определенной политике авторизации для указанного ресурса.

AuthorizeAsync(IAuthorizationService, ClaimsPrincipal, Object, AuthorizationPolicy)

Проверяет, соответствует ли пользователь определенной политике авторизации для указанного ресурса.

AuthorizeAsync(IAuthorizationService, ClaimsPrincipal, Object, IAuthorizationRequirement)

Проверяет, соответствует ли пользователь определенному требованию для указанного ресурса.

AuthorizeAsync(IAuthorizationService, ClaimsPrincipal, AuthorizationPolicy)

Исходный код:
AuthorizationServiceExtensions.cs
Исходный код:
AuthorizationServiceExtensions.cs
Исходный код:
AuthorizationServiceExtensions.cs
Исходный код:
AuthorizationServiceExtensions.cs
Исходный код:
AuthorizationServiceExtensions.cs
Исходный код:
AuthorizationServiceExtensions.cs
Исходный код:
AuthorizationServiceExtensions.cs
Исходный код:
AuthorizationServiceExtensions.cs
Исходный код:
AuthorizationServiceExtensions.cs

Проверяет, соответствует ли пользователь определенной политике авторизации для указанного ресурса.

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)

Параметры

service
IAuthorizationService

IAuthorizationService предоставления авторизации.

user
ClaimsPrincipal

Пользователь, который оценивает политику по отношению к ней.

policy
AuthorizationPolicy

Политика для оценки.

Возвращаемое значение

Флаг, указывающий, выполнена ли оценка политики успешно или не выполнена. Это значение true, если пользователь выполняет политику, в противном случае false.

Применяется к

AuthorizeAsync(IAuthorizationService, ClaimsPrincipal, String)

Исходный код:
AuthorizationServiceExtensions.cs
Исходный код:
AuthorizationServiceExtensions.cs
Исходный код:
AuthorizationServiceExtensions.cs
Исходный код:
AuthorizationServiceExtensions.cs
Исходный код:
AuthorizationServiceExtensions.cs
Исходный код:
AuthorizationServiceExtensions.cs
Исходный код:
AuthorizationServiceExtensions.cs
Исходный код:
AuthorizationServiceExtensions.cs
Исходный код:
AuthorizationServiceExtensions.cs

Проверяет, соответствует ли пользователь определенной политике авторизации для указанного ресурса.

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)

Параметры

service
IAuthorizationService

IAuthorizationService предоставления авторизации.

user
ClaimsPrincipal

Пользователь, который оценивает политику по отношению к ней.

policyName
String

Имя политики для оценки.

Возвращаемое значение

Флаг, указывающий, выполнена ли оценка политики успешно или не выполнена. Это значение true, если пользователь выполняет политику, в противном случае false.

Применяется к

AuthorizeAsync(IAuthorizationService, ClaimsPrincipal, Object, AuthorizationPolicy)

Исходный код:
AuthorizationServiceExtensions.cs
Исходный код:
AuthorizationServiceExtensions.cs
Исходный код:
AuthorizationServiceExtensions.cs
Исходный код:
AuthorizationServiceExtensions.cs
Исходный код:
AuthorizationServiceExtensions.cs
Исходный код:
AuthorizationServiceExtensions.cs
Исходный код:
AuthorizationServiceExtensions.cs
Исходный код:
AuthorizationServiceExtensions.cs
Исходный код:
AuthorizationServiceExtensions.cs

Проверяет, соответствует ли пользователь определенной политике авторизации для указанного ресурса.

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)

Параметры

service
IAuthorizationService

IAuthorizationService предоставления авторизации.

user
ClaimsPrincipal

Пользователь, который оценивает политику по отношению к ней.

resource
Object

Ресурс для оценки политики.

policy
AuthorizationPolicy

Политика для оценки.

Возвращаемое значение

Флаг, указывающий, выполнена ли оценка политики успешно или не выполнена. Это значение true, если пользователь выполняет политику, в противном случае false.

Применяется к

AuthorizeAsync(IAuthorizationService, ClaimsPrincipal, Object, IAuthorizationRequirement)

Исходный код:
AuthorizationServiceExtensions.cs
Исходный код:
AuthorizationServiceExtensions.cs
Исходный код:
AuthorizationServiceExtensions.cs
Исходный код:
AuthorizationServiceExtensions.cs
Исходный код:
AuthorizationServiceExtensions.cs
Исходный код:
AuthorizationServiceExtensions.cs
Исходный код:
AuthorizationServiceExtensions.cs
Исходный код:
AuthorizationServiceExtensions.cs
Исходный код:
AuthorizationServiceExtensions.cs

Проверяет, соответствует ли пользователь определенному требованию для указанного ресурса.

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)

Параметры

service
IAuthorizationService

IAuthorizationService предоставления авторизации.

user
ClaimsPrincipal

Пользователь, который оценивает политику по отношению к ней.

resource
Object

Ресурс для оценки политики.

requirement
IAuthorizationRequirement

Требование оценить политику по отношению к ней.

Возвращаемое значение

Флаг, указывающий, успешно ли выполнена оценка требований или завершилась ошибкой. Это значение true, если пользователь выполняет политику, в противном случае false.

Применяется к