AntiForgeryOptions Class

Summary

Provides programmatic configuration for the anti-forgery token system.

Syntax

public class AntiForgeryOptions

GitHub

View on GitHub

class Microsoft.AspNet.Mvc.AntiForgeryOptions

Constructors

Microsoft.AspNet.Mvc.AntiForgeryOptions.AntiForgeryOptions()
public AntiForgeryOptions()

Properties

CookieName()

Specifies the name of the cookie that is used by the anti-forgery system.

Return type:System.String
public string CookieName { get; set; }
FormFieldName()

Specifies the name of the anti-forgery token field that is used by the anti-forgery system.

Return type:System.String
public string FormFieldName { get; set; }
RequireSSL()

Specifies whether SSL is required for the anti-forgery system to operate. If this setting is ‘true’ and a non-SSL request comes into the system, all anti-forgery APIs will fail.

Return type:System.Boolean
public bool RequireSSL { get; set; }
SuppressXFrameOptionsHeader()

Specifies whether to suppress the generation of X-Frame-Options header which is used to prevent ClickJacking. By default, the X-Frame-Options header is generated with the value SAMEORIGIN. If this setting is ‘true’, the X-Frame-Options header will not be generated for the response.

Return type:System.Boolean
public bool SuppressXFrameOptionsHeader { get; set; }