AutoValidateAntiforgeryTokenAttribute 類別

定義

屬性,會針對所有不安全的 HTTP 方法,對反分叉權杖進行驗證。 GET、HEAD、OPTIONS 和 TRACE 以外的 HTTP 方法需要反分叉權杖。

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
繼承
AutoValidateAntiforgeryTokenAttribute
屬性
實作

備註

AutoValidateAntiforgeryTokenAttribute 可以套用為全域篩選準則,以觸發應用程式預設的反分機權杖驗證。 使用 IgnoreAntiforgeryTokenAttribute 來隱藏控制器或動作的反Forgery 權杖驗證。

建構函式

AutoValidateAntiforgeryTokenAttribute()

屬性,會針對所有不安全的 HTTP 方法,對反分叉權杖進行驗證。 GET、HEAD、OPTIONS 和 TRACE 以外的 HTTP 方法需要反分叉權杖。

屬性

IsReusable

取得值,這個值表示 是否可以跨要求重複使用 的結果 CreateInstance(IServiceProvider)

Order

取得決定篩選準則執行順序的順序值。 篩選會以屬性的 Order 遞增數值執行。

方法

CreateInstance(IServiceProvider)

建立可執行篩選準則的實例。

適用於