AuthorizeAttribute Class

Definition

Specifies that the class or method that this attribute is applied to requires the specified authorization.

C#
[System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Method, AllowMultiple=true, Inherited=true)]
public class AuthorizeAttribute : Attribute, Microsoft.AspNetCore.Authorization.IAuthorizeData
Inheritance
AuthorizeAttribute
Attributes
Implements

Constructors

AuthorizeAttribute()

Initializes a new instance of the AuthorizeAttribute class.

AuthorizeAttribute(String)

Initializes a new instance of the AuthorizeAttribute class with the specified policy.

Properties

ActiveAuthenticationSchemes
Obsolete.

Gets or sets a comma delimited list of schemes from which user information is constructed.

AuthenticationSchemes

Gets or sets a comma delimited list of schemes from which user information is constructed.

Policy

Gets or sets the policy name that determines access to the resource.

Roles

Gets or sets a comma delimited list of roles that are allowed to access the resource.

Methods

ToString() System.Attribute.ToString

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