AutoValidateAntiforgeryTokenAttribute AutoValidateAntiforgeryTokenAttribute AutoValidateAntiforgeryTokenAttribute Class

Definition

An attribute that causes validation of antiforgery tokens for all unsafe HTTP methods. An antiforgery token is required for HTTP methods other than GET, HEAD, OPTIONS, and TRACE.

[System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Method, AllowMultiple=false, Inherited=true)]
public class AutoValidateAntiforgeryTokenAttribute : Attribute, Microsoft.AspNetCore.Mvc.Filters.IFilterFactory, Microsoft.AspNetCore.Mvc.Filters.IOrderedFilter
type AutoValidateAntiforgeryTokenAttribute = class
    inherit Attribute
    interface IFilterFactory
    interface IFilterMetadata
    interface IOrderedFilter
Public Class AutoValidateAntiforgeryTokenAttribute
Inherits Attribute
Implements IFilterFactory, IOrderedFilter
Inheritance
AutoValidateAntiforgeryTokenAttributeAutoValidateAntiforgeryTokenAttributeAutoValidateAntiforgeryTokenAttribute
Attributes
Implements

Remarks

AutoValidateAntiforgeryTokenAttribute can be applied as a global filter to trigger validation of antiforgery tokens by default for an application. Use IgnoreAntiforgeryTokenAttribute to suppress validation of the antiforgery token for a controller or action.

Constructors

AutoValidateAntiforgeryTokenAttribute() AutoValidateAntiforgeryTokenAttribute() AutoValidateAntiforgeryTokenAttribute()

Properties

IsReusable IsReusable IsReusable
Order Order Order

Gets the order value for determining the order of execution of filters. Filters execute in ascending numeric value of the Order property.

Methods

CreateInstance(IServiceProvider) CreateInstance(IServiceProvider) CreateInstance(IServiceProvider)

Applies to