Delen via


IAntiforgery.GetTokens(HttpContext) Method

Definition

Generates an AntiforgeryTokenSet for this request.

public:
 Microsoft::AspNetCore::Antiforgery::AntiforgeryTokenSet ^ GetTokens(Microsoft::AspNetCore::Http::HttpContext ^ httpContext);
public Microsoft.AspNetCore.Antiforgery.AntiforgeryTokenSet GetTokens (Microsoft.AspNetCore.Http.HttpContext httpContext);
abstract member GetTokens : Microsoft.AspNetCore.Http.HttpContext -> Microsoft.AspNetCore.Antiforgery.AntiforgeryTokenSet
Public Function GetTokens (httpContext As HttpContext) As AntiforgeryTokenSet

Parameters

httpContext
HttpContext

The HttpContext associated with the current request.

Returns

The AntiforgeryTokenSet for this request.

Remarks

Unlike GetAndStoreTokens(HttpContext), this method has no side effect. The caller is responsible for setting the response cookie and injecting the returned form token as appropriate.

Applies to