3 instantiations of ClaimsAuthorizationRequirement
Microsoft.AspNetCore.Authorization (2)
AuthorizationPolicyBuilder.cs (2)
126Requirements.Add(new ClaimsAuthorizationRequirement(claimType, allowedValues)); 140Requirements.Add(new ClaimsAuthorizationRequirement(claimType, allowedValues: null));
Microsoft.AspNetCore.Authorization.Test (1)
ClaimsAuthorizationRequirementTests.cs (1)
12return new ClaimsAuthorizationRequirement(claimType, allowedValues);
16 references to ClaimsAuthorizationRequirement
Microsoft.AspNetCore.Authorization (7)
AuthorizationPolicyBuilder.cs (3)
102/// Adds a <see cref="ClaimsAuthorizationRequirement"/> to the current instance which requires 116/// Adds a <see cref="ClaimsAuthorizationRequirement"/> to the current instance which requires 131/// Adds a <see cref="ClaimsAuthorizationRequirement"/> to the current instance which requires
ClaimsAuthorizationRequirement.cs (4)
17public class ClaimsAuthorizationRequirement : AuthorizationHandler<ClaimsAuthorizationRequirement>, IAuthorizationRequirement 22/// Creates a new instance of <see cref="ClaimsAuthorizationRequirement"/>. 51protected override Task HandleRequirementAsync(AuthorizationHandlerContext context, ClaimsAuthorizationRequirement requirement) 94return $"{nameof(ClaimsAuthorizationRequirement)}:Claim.Type={ClaimType}{value}";
Microsoft.AspNetCore.Authorization.Test (7)
AuthorizationPolicyFacts.cs (2)
42Assert.Equal(2, combined.Requirements.OfType<ClaimsAuthorizationRequirement>().Count()); 92Assert.Equal(2, combined.Requirements.OfType<ClaimsAuthorizationRequirement>().Count());
ClaimsAuthorizationRequirementTests.cs (4)
10public ClaimsAuthorizationRequirement CreateRequirement(string claimType, params string[] allowedValues) 19var requirement = CreateRequirement("Custom", "CustomValue1", "CustomValue2"); 32var requirement = CreateRequirement("Custom", (string[])null); 45var requirement = CreateRequirement("Custom", Array.Empty<string>());
DefaultAuthorizationServiceTests.cs (1)
218Assert.IsType<ClaimsAuthorizationRequirement>(allowed.Failure.FailedRequirements.First());
Microsoft.AspNetCore.Mvc.Core.Test (2)
Authorization\AuthorizeFilterTest.cs (2)
532Assert.Equal(new[] { "Claim1", "Claim2" }, effectivePolicy.Requirements.Cast<ClaimsAuthorizationRequirement>().Select(c => c.ClaimType)); 568Assert.Equal(new[] { "Claim1", "Claim2" }, effectivePolicy.Requirements.Cast<ClaimsAuthorizationRequirement>().Select(c => c.ClaimType));