1 type derived from AuthorizationHandlerContext
Microsoft.AspNetCore.Authorization.Test (1)
DefaultAuthorizationServiceTests.cs (1)
1099public class BadContext : AuthorizationHandlerContext
1 instantiation of AuthorizationHandlerContext
Microsoft.AspNetCore.Authorization (1)
DefaultAuthorizationHandlerContextFactory.cs (1)
26return new AuthorizationHandlerContext(requirements, user, resource);
64 references to AuthorizationHandlerContext
BasicWebSite (1)
ManagerHandler.cs (1)
11protected override Task HandleRequirementAsync(AuthorizationHandlerContext context, OperationAuthorizationRequirement requirement)
CustomAuthorizationFailureResponse (3)
Authorization\Handlers\SampleRequirementHandler.cs (1)
12protected override Task HandleRequirementAsync(AuthorizationHandlerContext context, SampleRequirement requirement)
Authorization\Handlers\SampleWithCustomMessageRequirementHandler.cs (1)
12protected override Task HandleRequirementAsync(AuthorizationHandlerContext context, SampleWithCustomMessageRequirement requirement)
Authorization\Handlers\SampleWithFailureReasonRequirementHandler.cs (1)
12protected override Task HandleRequirementAsync(AuthorizationHandlerContext context, SampleFailReasonRequirement requirement)
CustomPolicyProvider (1)
Authorization\MinimumAgeAuthorizationHandler.cs (1)
25protected override Task HandleRequirementAsync(AuthorizationHandlerContext context, MinimumAgeRequirement requirement)
Microsoft.AspNetCore.Authorization (43)
AssertionRequirement.cs (4)
19public Func<AuthorizationHandlerContext, Task<bool>> Handler { get; } 25public AssertionRequirement(Func<AuthorizationHandlerContext, bool> handler) 36public AssertionRequirement(Func<AuthorizationHandlerContext, Task<bool>> handler) 47public async Task HandleAsync(AuthorizationHandlerContext context)
AuthorizationBuilder.cs (1)
29/// Determines whether authorization handlers should be invoked after <see cref="AuthorizationHandlerContext.HasFailed"/>.
AuthorizationFailure.cs (5)
20/// Failure was due to <see cref="AuthorizationHandlerContext.Fail()"/> being called. 25/// Failure was due to these requirements not being met via <see cref="AuthorizationHandlerContext.Succeed(IAuthorizationRequirement)"/>. 35/// Return a failure due to <see cref="AuthorizationHandlerContext.Fail()"/> being called. 41/// Return a failure due to <see cref="AuthorizationHandlerContext.Fail(AuthorizationFailureReason)"/> being called. 52/// Return a failure due to some requirements not being met via <see cref="AuthorizationHandlerContext.Succeed(IAuthorizationRequirement)"/>.
AuthorizationHandler.cs (4)
20public virtual async Task HandleAsync(AuthorizationHandlerContext context) 33protected abstract Task HandleRequirementAsync(AuthorizationHandlerContext context, TRequirement requirement); 49public virtual async Task HandleAsync(AuthorizationHandlerContext context) 66protected abstract Task HandleRequirementAsync(AuthorizationHandlerContext context, TRequirement requirement, TResource resource);
AuthorizationHandlerContext.cs (4)
23/// Creates a new instance of <see cref="AuthorizationHandlerContext"/>. 52/// The optional resource to evaluate the <see cref="AuthorizationHandlerContext.Requirements"/> against. 84/// Called to indicate <see cref="AuthorizationHandlerContext.HasSucceeded"/> will 93/// Called to indicate <see cref="AuthorizationHandlerContext.HasSucceeded"/> will
AuthorizationOptions.cs (1)
21/// Determines whether authorization handlers should be invoked after <see cref="AuthorizationHandlerContext.HasFailed"/>.
AuthorizationPolicyBuilder.cs (2)
199public AuthorizationPolicyBuilder RequireAssertion(Func<AuthorizationHandlerContext, bool> handler) 212public AuthorizationPolicyBuilder RequireAssertion(Func<AuthorizationHandlerContext, Task<bool>> handler)
ClaimsAuthorizationRequirement.cs (1)
51protected override Task HandleRequirementAsync(AuthorizationHandlerContext context, ClaimsAuthorizationRequirement requirement)
DefaultAuthorizationEvaluator.cs (1)
16public AuthorizationResult Evaluate(AuthorizationHandlerContext context)
DefaultAuthorizationHandlerContextFactory.cs (4)
10/// A type used to provide a <see cref="AuthorizationHandlerContext"/> used for authorization. 15/// Creates a <see cref="AuthorizationHandlerContext"/> used for authorization. 23/// <returns>The <see cref="AuthorizationHandlerContext"/>.</returns> 24public virtual AuthorizationHandlerContext CreateContext(IEnumerable<IAuthorizationRequirement> requirements, ClaimsPrincipal user, object? resource)
DefaultAuthorizationHandlerProvider.cs (1)
31public Task<IEnumerable<IAuthorizationHandler>> GetHandlersAsync(AuthorizationHandlerContext context)
DefaultAuthorizationService.cs (1)
66var authContext = _contextFactory.CreateContext(requirements, user, resource);
DenyAnonymousAuthorizationRequirement.cs (3)
11/// This calls <see cref="AuthorizationHandlerContext.Succeed(IAuthorizationRequirement)"/> for authenticated users. Like all built-in requirements, 12/// it never calls <see cref="AuthorizationHandlerContext.Fail()"/>. The <see cref="DefaultAuthorizationEvaluator"/> produces a failed <see cref="AuthorizationResult" /> 22protected override Task HandleRequirementAsync(AuthorizationHandlerContext context, DenyAnonymousAuthorizationRequirement requirement)
IAuthorizationEvaluator.cs (1)
16AuthorizationResult Evaluate(AuthorizationHandlerContext context);
IAuthorizationHandler.cs (1)
17Task HandleAsync(AuthorizationHandlerContext context);
IAuthorizationHandlerContextFactory.cs (4)
10/// A type used to provide a <see cref="AuthorizationHandlerContext"/> used for authorization. 15/// Creates a <see cref="AuthorizationHandlerContext"/> used for authorization. 23/// <returns>The <see cref="AuthorizationHandlerContext"/>.</returns> 24AuthorizationHandlerContext CreateContext(IEnumerable<IAuthorizationRequirement> requirements, ClaimsPrincipal user, object? resource);
IAuthorizationHandlerProvider.cs (2)
17/// <param name="context">The <see cref="AuthorizationHandlerContext"/>.</param> 19Task<IEnumerable<IAuthorizationHandler>> GetHandlersAsync(AuthorizationHandlerContext context);
NameAuthorizationRequirement.cs (1)
38protected override Task HandleRequirementAsync(AuthorizationHandlerContext context, NameAuthorizationRequirement requirement)
PassThroughAuthorizationHandler.cs (1)
35public async Task HandleAsync(AuthorizationHandlerContext context)
RolesAuthorizationRequirement.cs (1)
43protected override Task HandleRequirementAsync(AuthorizationHandlerContext context, RolesAuthorizationRequirement requirement)
Microsoft.AspNetCore.Authorization.Test (13)
AuthorizationMiddlewareTests.cs (1)
1063public Task HandleAsync(AuthorizationHandlerContext context) => Task.CompletedTask;
DefaultAuthorizationServiceTests.cs (11)
146public Task HandleAsync(AuthorizationHandlerContext context) 162public Task HandleAsync(AuthorizationHandlerContext context) 627protected override Task HandleRequirementAsync(AuthorizationHandlerContext context, CustomRequirement requirement) 685protected override Task HandleRequirementAsync(AuthorizationHandlerContext context, PassThroughRequirement requirement) 817protected override Task HandleRequirementAsync(AuthorizationHandlerContext context, OperationAuthorizationRequirement requirement, ExpenseReport resource) 829protected override Task HandleRequirementAsync(AuthorizationHandlerContext context, OperationAuthorizationRequirement requirement) 865protected override Task HandleRequirementAsync(AuthorizationHandlerContext context, OperationAuthorizationRequirement requirement, string resource) 873protected override Task HandleRequirementAsync(AuthorizationHandlerContext context, OperationAuthorizationRequirement requirement, int id) 1076public AuthorizationResult Evaluate(AuthorizationHandlerContext context) => AuthorizationResult.Success(); 1093public AuthorizationHandlerContext CreateContext(IEnumerable<IAuthorizationRequirement> requirements, ClaimsPrincipal user, object resource) 1133public Task<IEnumerable<IAuthorizationHandler>> GetHandlersAsync(AuthorizationHandlerContext context)
PassThroughAuthorizationHandlerTests.cs (1)
57protected override Task HandleRequirementAsync(AuthorizationHandlerContext context, SelfRequirement requirement)
Microsoft.AspNetCore.SignalR.Tests (3)
HubConnectionHandlerTests.cs (2)
2305public Task HandleAsync(AuthorizationHandlerContext context) 3712protected override async Task HandleRequirementAsync(AuthorizationHandlerContext context, DelayRequirement requirement, HubInvocationContext resource)
TestAuthHandler.cs (1)
12public Task HandleAsync(AuthorizationHandlerContext context)