Click or drag to resize

AntiForgery Class

Provides access to the anti-forgery system, which provides protection against Cross-site Request Forgery (CSRF, also called XSRF) attacks.
Inheritance Hierarchy
SystemObject
  GSF.Web.SecurityAntiForgery

Namespace: GSF.Web.Security
Assembly: GSF.Web (in GSF.Web.dll) Version: 2.4.218-beta
Syntax
public static class AntiForgery
View Source

The AntiForgery type exposes the following members.

Methods
 NameDescription
Public methodStatic memberGetHtml Generates an anti-forgery token for this request. This token can be validated by calling the Validate() method.
Public methodStatic memberGetTokens Generates an anti-forgery token pair (cookie and form token) for this request. This method is similar to GetHtml(), but this method gives the caller control over how to persist the returned values. To validate these tokens, call the appropriate overload of Validate.
Public methodStatic memberValidate(HttpRequestMessage) Validates an anti-forgery token that was supplied for this request. The anti-forgery token may be generated by calling GetHtml().
Public methodStatic memberValidate(HttpRequestMessage, String, String) Validates an anti-forgery token pair that was generated by the GetTokens method.
Top
See Also