2 instantiations of DenyAnonymousAuthorizationRequirement
Microsoft.AspNetCore.Authorization (1)
AuthorizationPolicyBuilder.cs (1)
18private static readonly DenyAnonymousAuthorizationRequirement _denyAnonymousAuthorizationRequirement = new();
Microsoft.AspNetCore.Authorization.Test (1)
DenyAnonymousAuthorizationRequirementTests.cs (1)
12return new DenyAnonymousAuthorizationRequirement();
19 references to DenyAnonymousAuthorizationRequirement
Microsoft.AspNetCore.Authorization (5)
AuthorizationPolicyBuilder.cs (2)
18private static readonly DenyAnonymousAuthorizationRequirement _denyAnonymousAuthorizationRequirement = new(); 185/// Adds <see cref="DenyAnonymousAuthorizationRequirement"/> to the current instance which enforces that the current user is authenticated.
DenyAnonymousAuthorizationRequirement.cs (3)
15public class DenyAnonymousAuthorizationRequirement : AuthorizationHandler<DenyAnonymousAuthorizationRequirement>, IAuthorizationRequirement 22protected override Task HandleRequirementAsync(AuthorizationHandlerContext context, DenyAnonymousAuthorizationRequirement requirement) 38return $"{nameof(DenyAnonymousAuthorizationRequirement)}: Requires an authenticated user.";
Microsoft.AspNetCore.Authorization.Test (5)
AuthorizationPolicyFacts.cs (3)
41Assert.Contains(combined.Requirements, r => r is DenyAnonymousAuthorizationRequirement); 66Assert.Empty(combined.Requirements.OfType<DenyAnonymousAuthorizationRequirement>()); 91Assert.DoesNotContain(combined.Requirements, r => r is DenyAnonymousAuthorizationRequirement);
DenyAnonymousAuthorizationRequirementTests.cs (2)
10private DenyAnonymousAuthorizationRequirement CreateRequirement() 19var requirement = CreateRequirement();
Microsoft.AspNetCore.Components.Authorization.Tests (9)
AuthorizeViewTest.cs (9)
46req => Assert.IsType<DenyAnonymousAuthorizationRequirement>(req)); 81req => Assert.IsType<DenyAnonymousAuthorizationRequirement>(req)); 109req => Assert.IsType<DenyAnonymousAuthorizationRequirement>(req)); 145req => Assert.IsType<DenyAnonymousAuthorizationRequirement>(req)); 181req => Assert.IsType<DenyAnonymousAuthorizationRequirement>(req)); 228req => Assert.IsType<DenyAnonymousAuthorizationRequirement>(req)); 345req => Assert.IsType<DenyAnonymousAuthorizationRequirement>(req)); 403req => Assert.IsType<DenyAnonymousAuthorizationRequirement>(req)); 474Assert.IsType<DenyAnonymousAuthorizationRequirement>(req));