CsrfTokenBadge
in package
implements
BadgeInterface
Adds automatic CSRF tokens checking capabilities to this authenticator.
Tags
Table of Contents
Interfaces
- BadgeInterface
- Passport badges allow to add more information to a passport (e.g. a CSRF token).
Properties
- $csrfToken : string|null
- $csrfTokenId : string
- $resolved : bool
Methods
- __construct() : mixed
- getCsrfToken() : string|null
- getCsrfTokenId() : string
- isResolved() : bool
- Checks if this badge is resolved by the security system.
Properties
$csrfToken
private
string|null
$csrfToken
$csrfTokenId
private
string
$csrfTokenId
$resolved
private
bool
$resolved
= false
Methods
__construct()
public
__construct(string $csrfTokenId, string|null $csrfToken) : mixed
Parameters
- $csrfTokenId : string
-
An arbitrary string used to generate the value of the CSRF token. Using a different string for each authenticator improves its security.
- $csrfToken : string|null
-
The CSRF token presented in the request, if any
getCsrfToken()
public
getCsrfToken() : string|null
Return values
string|nullgetCsrfTokenId()
public
getCsrfTokenId() : string
Return values
stringisResolved()
Checks if this badge is resolved by the security system.
public
isResolved() : bool
After authentication, all badges must return true
in this method in order
for the authentication to succeed.