Share via


AuthorizationHandlerContext Class

Definition

Contains authorization information used by IAuthorizationHandler.

public ref class AuthorizationHandlerContext
public class AuthorizationHandlerContext
type AuthorizationHandlerContext = class
Public Class AuthorizationHandlerContext
Inheritance
AuthorizationHandlerContext

Constructors

AuthorizationHandlerContext(IEnumerable<IAuthorizationRequirement>, ClaimsPrincipal, Object)

Creates a new instance of AuthorizationHandlerContext.

Properties

FailureReasons

Gets the reasons why authorization has failed.

HasFailed

Flag indicating whether the current authorization processing has failed due to Fail being called.

HasSucceeded

Flag indicating whether the current authorization processing has succeeded.

PendingRequirements

Gets the requirements that have not yet been marked as succeeded.

Requirements

The collection of all the IAuthorizationRequirement for the current authorization action.

Resource

The optional resource to evaluate the Requirements against.

User

The ClaimsPrincipal representing the current user.

Methods

Fail()

Called to indicate HasSucceeded will never return true, even if all requirements are met.

Fail(AuthorizationFailureReason)

Called to indicate HasSucceeded will never return true, even if all requirements are met.

Succeed(IAuthorizationRequirement)

Called to mark the specified requirement as being successfully evaluated.

Applies to