diff --git a/src/Microsoft.AspNet.Authorization/ClaimsAuthorizationHandler.cs b/src/Microsoft.AspNet.Authorization/ClaimsAuthorizationHandler.cs deleted file mode 100644 index fed436ad45..0000000000 --- a/src/Microsoft.AspNet.Authorization/ClaimsAuthorizationHandler.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System; -using System.Linq; - -namespace Microsoft.AspNet.Authorization -{ - public class ClaimsAuthorizationHandler : AuthorizationHandler - { - public override void Handle(AuthorizationContext context, ClaimsAuthorizationRequirement requirement) - { - if (context.User != null) - { - bool found = false; - if (requirement.AllowedValues == null || !requirement.AllowedValues.Any()) - { - found = context.User.Claims.Any(c => string.Equals(c.Type, requirement.ClaimType, StringComparison.OrdinalIgnoreCase)); - } - else - { - found = context.User.Claims.Any(c => string.Equals(c.Type, requirement.ClaimType, StringComparison.OrdinalIgnoreCase) - && requirement.AllowedValues.Contains(c.Value, StringComparer.Ordinal)); - } - if (found) - { - context.Succeed(requirement); - } - } - } - } -} diff --git a/src/Microsoft.AspNet.Authorization/DenyAnonymousAuthorizationHandler.cs b/src/Microsoft.AspNet.Authorization/DenyAnonymousAuthorizationHandler.cs deleted file mode 100644 index 3c1c872b39..0000000000 --- a/src/Microsoft.AspNet.Authorization/DenyAnonymousAuthorizationHandler.cs +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System.Linq; - -namespace Microsoft.AspNet.Authorization -{ - public class DenyAnonymousAuthorizationHandler : AuthorizationHandler - { - public override void Handle(AuthorizationContext context, DenyAnonymousAuthorizationRequirement requirement) - { - var user = context.User; - var userIsAnonymous = - user?.Identity == null || - !user.Identities.Any(i => i.IsAuthenticated); - if (!userIsAnonymous) - { - context.Succeed(requirement); - } - } - } -}