IAntiForgeryAdditionalDataProvider Interface

Provides a way to include or validate custom data for anti-forgery tokens.

Namespace:  System.Web.Helpers
Assembly:  System.Web.WebPages (in System.Web.WebPages.dll)

Syntax

'Declaration
Public Interface IAntiForgeryAdditionalDataProvider
'Usage
Dim instance As IAntiForgeryAdditionalDataProvider
public interface IAntiForgeryAdditionalDataProvider
public interface class IAntiForgeryAdditionalDataProvider
type IAntiForgeryAdditionalDataProvider =  interface end
public interface IAntiForgeryAdditionalDataProvider

The IAntiForgeryAdditionalDataProvider type exposes the following members.

Methods

  Name Description
Public method GetAdditionalData Provides additional data to store for the anti-forgery tokens that are generated during this request.
Public method ValidateAdditionalData Validates additional data that was embedded inside an incoming anti-forgery token.

Top

Remarks

The anti-forgery system already embeds the client's user name in the generated tokens. This interface lets you include and consume supplemental data. If an incoming anti-forgery token contains supplemental data but no additional data provider is configured, the supplemental data will not be validated.

As an example of how to use this interface, you could use the methods to supply a nonce when the token is generated and then validate the nonce when the token is validated.

See Also

Reference

System.Web.Helpers Namespace