DenyAnonymousAuthorizationRequirement Class

Definition

Implements an IAuthorizationHandler and IAuthorizationRequirement which requires the current user must be authenticated. This calls Succeed(IAuthorizationRequirement) for authenticated users. Like all built-in requirements, it never calls Fail(). The DefaultAuthorizationEvaluator produces a failed AuthorizationResult when any requirement has not succeeded even if other requirements have succeeded, and no requirement has explicitly failed.

C#
public class DenyAnonymousAuthorizationRequirement : Microsoft.AspNetCore.Authorization.AuthorizationHandler<Microsoft.AspNetCore.Authorization.Infrastructure.DenyAnonymousAuthorizationRequirement>, Microsoft.AspNetCore.Authorization.IAuthorizationRequirement
Inheritance
DenyAnonymousAuthorizationRequirement
Implements

Constructors

Methods

HandleAsync(AuthorizationHandlerContext)

Makes a decision if authorization is allowed.

(Inherited from AuthorizationHandler<TRequirement>)
HandleRequirementAsync(AuthorizationHandlerContext, DenyAnonymousAuthorizationRequirement)

Makes a decision if authorization is allowed based on a specific requirement.

HandleRequirementAsync(AuthorizationHandlerContext, TRequirement)

Makes a decision if authorization is allowed based on a specific requirement.

(Inherited from AuthorizationHandler<TRequirement>)
ToString()

Returns a string that represents the current object.

Applies to

Product Versions
ASP.NET Core 1.0, 1.1, 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0