class CsrfTokenManagerAdapter implements CsrfProviderInterface

deprecated since version 2.4, to be removed in 3.0.

Adapter for using the new token generator with the old interface.

Methods

__construct(CsrfTokenManagerInterface $tokenManager)

No description

getTokenManager($triggerDeprecationError = true)

No description

string
generateCsrfToken(string $intention)

Generates a CSRF token for a page of your application.

bool
isCsrfTokenValid(string $intention, string $token)

Validates a CSRF token.

Details

at line 28
__construct(CsrfTokenManagerInterface $tokenManager)

Parameters

CsrfTokenManagerInterface $tokenManager

at line 33
getTokenManager($triggerDeprecationError = true)

Parameters

$triggerDeprecationError

at line 45
string generateCsrfToken(string $intention)

Generates a CSRF token for a page of your application.

Parameters

string $intention Some value that identifies the action intention (i.e. "authenticate"). Doesn't have to be a secret value.

Return Value

string The generated token

at line 55
bool isCsrfTokenValid(string $intention, string $token)

Validates a CSRF token.

Parameters

string $intention The intention used when generating the CSRF token
string $token The token supplied by the browser

Return Value

bool Whether the token supplied by the browser is correct