PolicyEvaluator.AuthorizeAsync(AuthorizationPolicy, AuthenticateResult, HttpContext, Object) 메서드

정의

을 사용 하 여 정책에 대 한 권한 부여를 시도 IAuthorizationService 합니다.

public:
 virtual System::Threading::Tasks::Task<Microsoft::AspNetCore::Authorization::Policy::PolicyAuthorizationResult ^> ^ AuthorizeAsync(Microsoft::AspNetCore::Authorization::AuthorizationPolicy ^ policy, Microsoft::AspNetCore::Authentication::AuthenticateResult ^ authenticationResult, Microsoft::AspNetCore::Http::HttpContext ^ context, System::Object ^ resource);
public virtual System.Threading.Tasks.Task<Microsoft.AspNetCore.Authorization.Policy.PolicyAuthorizationResult> AuthorizeAsync (Microsoft.AspNetCore.Authorization.AuthorizationPolicy policy, Microsoft.AspNetCore.Authentication.AuthenticateResult authenticationResult, Microsoft.AspNetCore.Http.HttpContext context, object resource);
public virtual System.Threading.Tasks.Task<Microsoft.AspNetCore.Authorization.Policy.PolicyAuthorizationResult> AuthorizeAsync (Microsoft.AspNetCore.Authorization.AuthorizationPolicy policy, Microsoft.AspNetCore.Authentication.AuthenticateResult authenticationResult, Microsoft.AspNetCore.Http.HttpContext context, object? resource);
abstract member AuthorizeAsync : Microsoft.AspNetCore.Authorization.AuthorizationPolicy * Microsoft.AspNetCore.Authentication.AuthenticateResult * Microsoft.AspNetCore.Http.HttpContext * obj -> System.Threading.Tasks.Task<Microsoft.AspNetCore.Authorization.Policy.PolicyAuthorizationResult>
override this.AuthorizeAsync : Microsoft.AspNetCore.Authorization.AuthorizationPolicy * Microsoft.AspNetCore.Authentication.AuthenticateResult * Microsoft.AspNetCore.Http.HttpContext * obj -> System.Threading.Tasks.Task<Microsoft.AspNetCore.Authorization.Policy.PolicyAuthorizationResult>
Public Overridable Function AuthorizeAsync (policy As AuthorizationPolicy, authenticationResult As AuthenticateResult, context As HttpContext, resource As Object) As Task(Of PolicyAuthorizationResult)

매개 변수

authenticationResult
AuthenticateResult

에 대 한 호출의 결과입니다 AuthenticateAsync(AuthorizationPolicy, HttpContext) .

resource
Object

정책을 확인 해야 하는 선택적 리소스입니다. 정책 평가에 리소스가 필요 하지 않은 경우 값으로 null을 전달할 수 있습니다.

반환

Task<PolicyAuthorizationResult>

Success()권한 부여가 성공 하면를 반환 합니다. 그렇지 않으면 Forbid(AuthorizationFailure) Succeeded 를 반환 하 고, 그렇지 않으면를 반환 합니다. Challenge()

구현

적용 대상