Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

AutoValidateAntiforgeryTokenAttribute Class

Definition

Namespace:
Microsoft.AspNetCore.Mvc
Assembly:
Microsoft.AspNetCore.Mvc.ViewFeatures.dll
Package:
Microsoft.AspNetCore.Mvc.ViewFeatures v1.0.0
Package:
Microsoft.AspNetCore.Mvc.ViewFeatures v1.1.0
Package:
Microsoft.AspNetCore.App.Ref v10.0.0
Package:
Microsoft.AspNetCore.App.Ref v11.0.0-preview.4.26230.115
Package:
Microsoft.AspNetCore.Mvc.ViewFeatures v2.0.0
Package:
Microsoft.AspNetCore.Mvc.ViewFeatures v2.1.0
Package:
Microsoft.AspNetCore.Mvc.ViewFeatures v2.2.0
Package:
Microsoft.AspNetCore.App.Ref v3.0.1
Package:
Microsoft.AspNetCore.App.Ref v3.1.10
Package:
Microsoft.AspNetCore.App.Ref v5.0.0
Package:
Microsoft.AspNetCore.App.Ref v6.0.36
Package:
Microsoft.AspNetCore.App.Ref v7.0.5
Package:
Microsoft.AspNetCore.App.Ref v8.0.19
Package:
Microsoft.AspNetCore.App.Ref v9.0.8
Source:
AutoValidateAntiforgeryTokenAttribute.cs
Source:
AutoValidateAntiforgeryTokenAttribute.cs
Source:
AutoValidateAntiforgeryTokenAttribute.cs

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

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.

public ref class AutoValidateAntiforgeryTokenAttribute : Attribute, Microsoft::AspNetCore::Mvc::Filters::IFilterFactory, Microsoft::AspNetCore::Mvc::Filters::IOrderedFilter
[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
[<System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Method, AllowMultiple=false, Inherited=true)>]
type AutoValidateAntiforgeryTokenAttribute = class
 inherit Attribute
 interface IFilterFactory
 interface IFilterMetadata
 interface IOrderedFilter
Public Class AutoValidateAntiforgeryTokenAttribute
Inherits Attribute
Implements IFilterFactory, IOrderedFilter
Inheritance
AutoValidateAntiforgeryTokenAttribute
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

Name Description
AutoValidateAntiforgeryTokenAttribute()

Properties

Name Description
IsReusable

Gets a value that indicates if the result of CreateInstance(IServiceProvider) can be reused across requests.

Order

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

Methods

Name Description
CreateInstance(IServiceProvider)

Creates an instance of the executable filter.

Applies to


Feedback

Was this page helpful?