Click or drag to resize

AntiForgery Methods

The AntiForgery type exposes the following members.

Methods
  Name Description
Public method Static member GetHtml Generates an anti-forgery token for this request. This token can be validated by calling the Validate() method.
Public method Static member GetTokens 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 method Static member Validate(HttpRequestMessage) Validates an anti-forgery token that was supplied for this request. The anti-forgery token may be generated by calling GetHtml().
Public method Static member Validate(HttpRequestMessage, String, String) Validates an anti-forgery token pair that was generated by the GetTokens method.
Top
See Also