# C1.Web.Mvc.C1AntiForgeryTokenAttribute

## Content

<div class="doc-site-dotnet-api-container">



  <h1 id="C1_Web_Mvc_C1AntiForgeryTokenAttribute" data-uid="C1.Web.Mvc.C1AntiForgeryTokenAttribute" class="text-break">C1AntiForgeryTokenAttribute Class
</h1>
  <div class="markdown level0 summary"><p>C1AntiForgeryTokenAttribute provides support for MVC AntiForgency feature</p>
</div>
  <div class="markdown level0 conceptual"></div>
  <div class="inheritance">
    <h5>Inheritance</h5>
    <div class="level0"><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object">object</a></div>
    <div class="level1"><span class="xref">C1AntiForgeryTokenAttribute</span></div>
  </div>
  <div class="implements">
    <h5>Implements</h5>
    <div><span class="xref">IAuthorizationFilter</span></div>
  </div>
  <h6><strong>Namespace</strong>: <a class="xref" href="C1.Web.Mvc.html">C1.Web.Mvc</a></h6>
  <h6><strong>Assembly</strong>: C1.Web.Mvc.dll</h6>
  <h5 id="C1_Web_Mvc_C1AntiForgeryTokenAttribute_syntax">Syntax</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">[AttributeUsage(AttributeTargets.Class|AttributeTargets.Method, AllowMultiple = false, Inherited = true)]
public sealed class C1AntiForgeryTokenAttribute : FilterAttribute, IAuthorizationFilter</code></pre>
  </div>
  <div class="codewrapper">
    <pre><code class="lang-vbnet hljs">&lt;AttributeUsage(AttributeTargets.ClassOrAttributeTargets.Method, AllowMultiple:=False, Inherited:=True)&gt;
Public NotInheritable Class C1AntiForgeryTokenAttribute
    Inherits FilterAttribute
    Implements IAuthorizationFilter</code></pre>
  </div>
  <h3 id="constructors">Constructors
</h3>
  <table class="table table-bordered table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td id="C1_Web_Mvc_C1AntiForgeryTokenAttribute__ctor" data-uid="C1.Web.Mvc.C1AntiForgeryTokenAttribute.#ctor">
          <a class="xref" href="C1.Web.Mvc.C1AntiForgeryTokenAttribute.-ctor.html#C1_Web_Mvc_C1AntiForgeryTokenAttribute__ctor">C1AntiForgeryTokenAttribute()</a>
        </td>
        <td class="markdown level1 summary"></td>
      </tr>
    </tbody>
  </table>
  <h3 id="methods">Methods
</h3>
  <table class="table table-bordered table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td id="C1_Web_Mvc_C1AntiForgeryTokenAttribute_OnAuthorization_System_Web_Mvc_AuthorizationContext_" data-uid="C1.Web.Mvc.C1AntiForgeryTokenAttribute.OnAuthorization(System.Web.Mvc.AuthorizationContext)">
          <a class="xref" href="C1.Web.Mvc.C1AntiForgeryTokenAttribute.OnAuthorization.html#C1_Web_Mvc_C1AntiForgeryTokenAttribute_OnAuthorization_System_Web_Mvc_AuthorizationContext_">OnAuthorization(AuthorizationContext)</a>
        </td>
        <td class="markdown level1 summary"><p>Implement the authorizing logic base on the RequestVerificationToken value in the request header.</p>
</td>
      </tr>
    </tbody>
  </table>

</div>
