private static void AssertUserAnonymousAffectsSuccess(ClaimsPrincipal user, bool shouldSucceed)
        {
            var requirement = new DenyAnonymousAuthorizationRequirement();
            var context     = new AuthorizationContext(new[] { requirement }, user, null);

            requirement.Handle(context);
            Assert.AreEqual(shouldSucceed, context.HasSucceeded);
        }
 public void HandleProtected(AuthorizationContext context, DenyAnonymousAuthorizationRequirement requirement)
 {
     Handle(context, requirement);
 }
Ejemplo n.º 3
0
 public async Task HandleProtectedAsync(AuthorizationHandlerContext context, DenyAnonymousAuthorizationRequirement requirement)
 {
     await HandleRequirementAsync(context, requirement);
 }