class SwitchUserListener implements ListenerInterface

SwitchUserListener allows a user to impersonate another one temporarily (like the Unix su command).

Constants

EXIT_VALUE

Methods

__construct(TokenStorageInterface $tokenStorage, UserProviderInterface $provider, UserCheckerInterface $userChecker, string $providerKey, AccessDecisionManagerInterface $accessDecisionManager, LoggerInterface $logger = null, string $usernameParameter = '_switch_user', string $role = 'ROLE_ALLOWED_TO_SWITCH', EventDispatcherInterface $dispatcher = null, bool $stateless = false)

No description

handle(GetResponseEvent $event)

Handles the switch to another user.

Details

at line 54
__construct(TokenStorageInterface $tokenStorage, UserProviderInterface $provider, UserCheckerInterface $userChecker, string $providerKey, AccessDecisionManagerInterface $accessDecisionManager, LoggerInterface $logger = null, string $usernameParameter = '_switch_user', string $role = 'ROLE_ALLOWED_TO_SWITCH', EventDispatcherInterface $dispatcher = null, bool $stateless = false)

Parameters

TokenStorageInterface $tokenStorage
UserProviderInterface $provider
UserCheckerInterface $userChecker
string $providerKey
AccessDecisionManagerInterface $accessDecisionManager
LoggerInterface $logger
string $usernameParameter
string $role
EventDispatcherInterface $dispatcher
bool $stateless

at line 77
handle(GetResponseEvent $event)

Handles the switch to another user.

Parameters

GetResponseEvent $event

Exceptions

LogicException if switching to a user failed