Method | Description | |
---|---|---|
__construct ( Symfony\Component\EventDispatcher\EventDispatcherInterface $eventDispatcher, boolean $csrfEnabled, string $csrfTokenIntention, Symfony\Component\Security\Csrf\CsrfTokenManagerInterface $csrfTokenManager = null ) | Note that CSRF provider needs to be optional as it will not be available when CSRF protection is disabled. | |
getSubscribedEvents ( ) : array | ||
onKernelRequest ( |
This method validates CSRF token if CSRF protection is enabled. |
Method | Description | |
---|---|---|
checkCsrfToken ( |
Checks the validity of the request's csrf token header. | |
isLoginRequest ( string $route ) : boolean | ||
isMethodSafe ( string $method ) : boolean | ||
isSessionRoute ( string $route ) : boolean | Tests if a given $route is a session management one. |
public __construct ( Symfony\Component\EventDispatcher\EventDispatcherInterface $eventDispatcher, boolean $csrfEnabled, string $csrfTokenIntention, Symfony\Component\Security\Csrf\CsrfTokenManagerInterface $csrfTokenManager = null ) | ||
$eventDispatcher | Symfony\Component\EventDispatcher\EventDispatcherInterface | |
$csrfEnabled | boolean | |
$csrfTokenIntention | string | |
$csrfTokenManager | Symfony\Component\Security\Csrf\CsrfTokenManagerInterface |
protected checkCsrfToken ( |
||
$request | ||
return | boolean | true/false if the token is valid/invalid, false if none was found in the request's headers. |
public static getSubscribedEvents ( ) : array | ||
return | array |
protected isLoginRequest ( string $route ) : boolean | ||
$route | string | |
return | boolean |
protected isMethodSafe ( string $method ) : boolean | ||
$method | string | |
return | boolean |
protected isSessionRoute ( string $route ) : boolean | ||
$route | string | |
return | boolean |
public onKernelRequest ( |
||
$event |