RequireAntiforgeryTokenAttribute クラス
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
偽造防止トークンを検証する必要があるかどうかを示すために使用できる属性。
[System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Method)]
public class RequireAntiforgeryTokenAttribute : Attribute, Microsoft.AspNetCore.Antiforgery.IAntiforgeryMetadata
[<System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Method)>]
type RequireAntiforgeryTokenAttribute = class
inherit Attribute
interface IAntiforgeryMetadata
Public Class RequireAntiforgeryTokenAttribute
Inherits Attribute
Implements IAntiforgeryMetadata
- 継承
-
RequireAntiforgeryTokenAttribute
- 属性
- 実装
注釈
UseAntiforgery(IApplicationBuilder)によって実行される検証は、HTTP POST、PUT、PATCH 要求にのみ適用されます。 他の HTTP メソッドを使用するエンドポイントは、この属性が適用されている場合でもミドルウェアによってスキップされます。
他の HTTP メソッドの検証が必要な場合は、 IAntiforgery を解決し、ハンドラーで ValidateRequestAsync(HttpContext) または IsRequestValidAsync(HttpContext) を呼び出します。
コンストラクター
| Name | 説明 |
|---|---|
| RequireAntiforgeryTokenAttribute(Boolean) |
偽造防止トークンを検証する必要があるかどうかを示すために使用できる属性。 |
プロパティ
| Name | 説明 |
|---|---|
| RequiresValidation |
偽造防止トークンを検証するかどうかを示す値を取得または設定します。 |