ContextListener
class ContextListener implements ListenerInterface
ContextListener manages the SecurityContext persistence through a session.
Methods
__construct(TokenStorageInterface $tokenStorage, iterable $userProviders, string $contextKey, LoggerInterface $logger = null, EventDispatcherInterface $dispatcher = null, AuthenticationTrustResolverInterface $trustResolver = null) | ||
setLogoutOnUserChange(bool $logoutOnUserChange) Enables deauthentication during refreshUser when the user has changed. | ||
handle(GetResponseEvent $event) Reads the Security Token from the session. | ||
onKernelResponse(FilterResponseEvent $event) Writes the security token into the session. |
Details
__construct(TokenStorageInterface $tokenStorage, iterable $userProviders, string $contextKey, LoggerInterface $logger = null, EventDispatcherInterface $dispatcher = null, AuthenticationTrustResolverInterface $trustResolver = null)
Parameters
TokenStorageInterface | $tokenStorage | |
iterable | $userProviders | |
string | $contextKey | |
LoggerInterface | $logger | |
EventDispatcherInterface | $dispatcher | |
AuthenticationTrustResolverInterface | $trustResolver |
setLogoutOnUserChange(bool $logoutOnUserChange)
Enables deauthentication during refreshUser when the user has changed.
Parameters
bool | $logoutOnUserChange |
handle(GetResponseEvent $event)
Reads the Security Token from the session.
Parameters
GetResponseEvent | $event |
onKernelResponse(FilterResponseEvent $event)
Writes the security token into the session.
Parameters
FilterResponseEvent | $event |
© 2004–2017 Fabien Potencier
Licensed under the MIT License.
http://api.symfony.com/4.0/Symfony/Component/Security/Http/Firewall/ContextListener.html