20 implementations of IAuthorizationRequirement
CustomAuthorizationFailureResponse (3)
Authorization\Requirements\SampleFailReasonRequirement.cs (1)
8public class SampleFailReasonRequirement : IAuthorizationRequirement
Authorization\Requirements\SampleRequirement.cs (1)
8public class SampleRequirement : IAuthorizationRequirement
Authorization\Requirements\SampleWithCustomMessageRequirement.cs (1)
8public class SampleWithCustomMessageRequirement : IAuthorizationRequirement
CustomPolicyProvider (1)
Authorization\MinimumAgeRequirement.cs (1)
8internal class MinimumAgeRequirement : IAuthorizationRequirement
Microsoft.AspNetCore.Authorization (6)
AssertionRequirement.cs (1)
14public class AssertionRequirement : IAuthorizationHandler, IAuthorizationRequirement
ClaimsAuthorizationRequirement.cs (1)
17public class ClaimsAuthorizationRequirement : AuthorizationHandler<ClaimsAuthorizationRequirement>, IAuthorizationRequirement
DenyAnonymousAuthorizationRequirement.cs (1)
15public class DenyAnonymousAuthorizationRequirement : AuthorizationHandler<DenyAnonymousAuthorizationRequirement>, IAuthorizationRequirement
NameAuthorizationRequirement.cs (1)
15public class NameAuthorizationRequirement : AuthorizationHandler<NameAuthorizationRequirement>, IAuthorizationRequirement
OperationAuthorizationRequirement.cs (1)
10public class OperationAuthorizationRequirement : IAuthorizationRequirement
RolesAuthorizationRequirement.cs (1)
16public class RolesAuthorizationRequirement : AuthorizationHandler<RolesAuthorizationRequirement>, IAuthorizationRequirement
Microsoft.AspNetCore.Authorization.Test (6)
AuthorizationEndpointConventionBuilderExtensionsTests.cs (1)
218class TestRequirement : IAuthorizationRequirement { }
DefaultAuthorizationServiceTests.cs (3)
622public class CustomRequirement : IAuthorizationRequirement { } 676public class PassThroughRequirement : AuthorizationHandler<PassThroughRequirement>, IAuthorizationRequirement 1150public class LogRequirement : IAuthorizationRequirement
PassThroughAuthorizationHandlerTests.cs (1)
49public class SelfRequirement : AuthorizationHandler<SelfRequirement>, IAuthorizationRequirement
PolicyEvaluatorTests.cs (1)
228private class DummyRequirement : IAuthorizationRequirement { }
Microsoft.AspNetCore.Components.Authorization.Tests (1)
TestAuthorizationPolicyProvider.cs (1)
26public class TestPolicyRequirement : IAuthorizationRequirement
Microsoft.AspNetCore.Http.Connections.Tests (1)
MapConnectionHandlerTests.cs (1)
480private class TestRequirement : IAuthorizationRequirement
Microsoft.AspNetCore.SignalR.Tests (2)
HubConnectionHandlerTests.cs (1)
3704private class DelayRequirement : AuthorizationHandler<DelayRequirement, HubInvocationContext>, IAuthorizationRequirement
MapSignalRTests.cs (1)
391private class TestRequirement : IAuthorizationRequirement
68 references to IAuthorizationRequirement
Microsoft.AspNetCore.Authorization (47)
AssertionRequirement.cs (1)
11/// Implements an <see cref="IAuthorizationHandler"/> and <see cref="IAuthorizationRequirement"/>
AuthorizationFailure.cs (6)
11/// Encapsulates a failure result of <see cref="IAuthorizationService.AuthorizeAsync(ClaimsPrincipal, object, IEnumerable{IAuthorizationRequirement})"/>. 25/// Failure was due to these requirements not being met via <see cref="AuthorizationHandlerContext.Succeed(IAuthorizationRequirement)"/>. 27public IEnumerable<IAuthorizationRequirement> FailedRequirements { get; private set; } = Array.Empty<IAuthorizationRequirement>(); 52/// Return a failure due to some requirements not being met via <see cref="AuthorizationHandlerContext.Succeed(IAuthorizationRequirement)"/>. 56public static AuthorizationFailure Failed(IEnumerable<IAuthorizationRequirement> failed)
AuthorizationHandler.cs (2)
14where TRequirement : IAuthorizationRequirement 43where TRequirement : IAuthorizationRequirement
AuthorizationHandlerContext.cs (8)
17private readonly HashSet<IAuthorizationRequirement> _pendingRequirements; 25/// <param name="requirements">A collection of all the <see cref="IAuthorizationRequirement"/> for the current authorization action.</param> 29IEnumerable<IAuthorizationRequirement> requirements, 38_pendingRequirements = new HashSet<IAuthorizationRequirement>(requirements); 42/// The collection of all the <see cref="IAuthorizationRequirement"/> for the current authorization action. 44public virtual IEnumerable<IAuthorizationRequirement> Requirements { get; } 59public virtual IEnumerable<IAuthorizationRequirement> PendingRequirements { get { return _pendingRequirements; } } 116public virtual void Succeed(IAuthorizationRequirement requirement)
AuthorizationPolicy.cs (5)
23/// The list of <see cref="IAuthorizationRequirement"/>s which must succeed for 29public AuthorizationPolicy(IEnumerable<IAuthorizationRequirement> requirements, IEnumerable<string> authenticationSchemes) 38Requirements = new List<IAuthorizationRequirement>(requirements).AsReadOnly(); 43/// Gets a readonly list of <see cref="IAuthorizationRequirement"/>s which must succeed for 46public IReadOnlyList<IAuthorizationRequirement> Requirements { get; }
AuthorizationPolicyBuilder.cs (6)
39/// Gets or sets a list of <see cref="IAuthorizationRequirement"/>s which must succeed for 42public IList<IAuthorizationRequirement> Requirements { get; set; } = new List<IAuthorizationRequirement>(); 76public AuthorizationPolicyBuilder AddRequirements(params IAuthorizationRequirement[] requirements) => AddRequirementsCore(requirements); 78private AuthorizationPolicyBuilder AddRequirementsCore(IEnumerable<IAuthorizationRequirement> requirements) 80foreach (var req in requirements)
AuthorizationResult.cs (1)
11/// Encapsulates the result of <see cref="IAuthorizationService.AuthorizeAsync(ClaimsPrincipal, object, IEnumerable{IAuthorizationRequirement})"/>.
AuthorizationServiceExtensions.cs (2)
27public static Task<AuthorizationResult> AuthorizeAsync(this IAuthorizationService service, ClaimsPrincipal user, object? resource, IAuthorizationRequirement requirement) 32return service.AuthorizeAsync(user, resource, new IAuthorizationRequirement[] { requirement });
ClaimsAuthorizationRequirement.cs (1)
13/// Implements an <see cref="IAuthorizationHandler"/> and <see cref="IAuthorizationRequirement"/>
DefaultAuthorizationHandlerContextFactory.cs (1)
24public virtual AuthorizationHandlerContext CreateContext(IEnumerable<IAuthorizationRequirement> requirements, ClaimsPrincipal user, object? resource)
DefaultAuthorizationService.cs (2)
30/// <param name="handlers">The handlers used to fulfill <see cref="IAuthorizationRequirement"/>s.</param> 62public virtual async Task<AuthorizationResult> AuthorizeAsync(ClaimsPrincipal user, object? resource, IEnumerable<IAuthorizationRequirement> requirements)
DenyAnonymousAuthorizationRequirement.cs (2)
10/// Implements an <see cref="IAuthorizationHandler"/> and <see cref="IAuthorizationRequirement"/> which requires the current user must be authenticated. 11/// This calls <see cref="AuthorizationHandlerContext.Succeed(IAuthorizationRequirement)"/> for authenticated users. Like all built-in requirements,
IAuthorizationHandlerContextFactory.cs (1)
24AuthorizationHandlerContext CreateContext(IEnumerable<IAuthorizationRequirement> requirements, ClaimsPrincipal user, object? resource);
IAuthorizationRequirementData.cs (3)
14/// Returns <see cref="IAuthorizationRequirement"/> that should be satisfied for authorization. 16/// <returns><see cref="IAuthorizationRequirement"/> used for authorization.</returns> 17IEnumerable<IAuthorizationRequirement> GetRequirements();
IAuthorizationService.cs (1)
32Task<AuthorizationResult> AuthorizeAsync(ClaimsPrincipal user, object? resource, IEnumerable<IAuthorizationRequirement> requirements);
NameAuthorizationRequirement.cs (1)
12/// Implements an <see cref="IAuthorizationHandler"/> and <see cref="IAuthorizationRequirement"/>
OperationAuthorizationRequirement.cs (2)
7/// A helper class to provide a useful <see cref="IAuthorizationRequirement"/> which 13/// The name of this instance of <see cref="IAuthorizationRequirement"/>.
PassThroughAuthorizationHandler.cs (1)
11/// Infrastructure class which allows an <see cref="IAuthorizationRequirement"/> to
RolesAuthorizationRequirement.cs (1)
13/// Implements an <see cref="IAuthorizationHandler"/> and <see cref="IAuthorizationRequirement"/>
Microsoft.AspNetCore.Authorization.Policy (1)
AuthorizationMiddleware.cs (1)
128foreach (var r in rd.GetRequirements())
Microsoft.AspNetCore.Authorization.Test (10)
AuthorizationMiddlewareTests.cs (6)
442IEnumerable<IAuthorizationRequirement> _reqs; 443public ReqAttribute(params IAuthorizationRequirement[] req) 446public IEnumerable<IAuthorizationRequirement> GetRequirements() 452IEnumerable<IAuthorizationRequirement> _reqs; 453public ReqAuthorizeAttribute(params IAuthorizationRequirement[] req) 456public IEnumerable<IAuthorizationRequirement> GetRequirements()
DefaultAuthorizationServiceTests.cs (2)
1093public AuthorizationHandlerContext CreateContext(IEnumerable<IAuthorizationRequirement> requirements, ClaimsPrincipal user, object resource) 1101public BadContext() : base(new List<IAuthorizationRequirement>(), null, null) { }
PolicyEvaluatorTests.cs (2)
171public Task<AuthorizationResult> AuthorizeAsync(ClaimsPrincipal user, object resource, IEnumerable<IAuthorizationRequirement> requirements) 180public Task<AuthorizationResult> AuthorizeAsync(ClaimsPrincipal user, object resource, IEnumerable<IAuthorizationRequirement> requirements)
Microsoft.AspNetCore.Components.Authorization.Tests (6)
TestAsyncAuthorizationService.cs (3)
14public List<(ClaimsPrincipal user, object resource, IEnumerable<IAuthorizationRequirement> requirements)> AuthorizeCalls { get; } 15= new List<(ClaimsPrincipal user, object resource, IEnumerable<IAuthorizationRequirement> requirements)>(); 17public async Task<AuthorizationResult> AuthorizeAsync(ClaimsPrincipal user, object resource, IEnumerable<IAuthorizationRequirement> requirements)
TestAuthorizationService.cs (3)
14public List<(ClaimsPrincipal user, object resource, IEnumerable<IAuthorizationRequirement> requirements)> AuthorizeCalls { get; } 15= new List<(ClaimsPrincipal user, object resource, IEnumerable<IAuthorizationRequirement> requirements)>(); 17public Task<AuthorizationResult> AuthorizeAsync(ClaimsPrincipal user, object resource, IEnumerable<IAuthorizationRequirement> requirements)
Microsoft.AspNetCore.Mvc.Core.Test (2)
ApplicationModels\AuthorizationApplicationModelProviderTest.cs (2)
125var requirements = new IAuthorizationRequirement[] 151var requirements = new IAuthorizationRequirement[]
Microsoft.AspNetCore.Mvc.IntegrationTests (1)
AuthorizeFilterIntegrationTest.cs (1)
200var requirements = new IAuthorizationRequirement[]
Microsoft.AspNetCore.SignalR.Tests (1)
TestAuthHandler.cs (1)
14foreach (var req in context.Requirements)