ValidateAntiForgeryTokenAttribute 類別

定義

指定套用此屬性的類別或方法會驗證防偽權杖。 如果無法使用防偽造權杖,或權杖無效,驗證將會失敗,且動作方法不會執行。

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

備註

這個屬性可協助防範跨站台要求偽造。 它不會防止其他偽造或竄改攻擊。

建構函式

ValidateAntiForgeryTokenAttribute()

指定套用此屬性的類別或方法會驗證防偽權杖。 如果無法使用防偽造權杖,或權杖無效,驗證將會失敗,且動作方法不會執行。

屬性

IsReusable

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

Order

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

方法

CreateInstance(IServiceProvider)

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

適用於