PHP Class Symfony\Component\HttpKernel\Security\Firewall\SwitchUserListener

Author: Fabien Potencier ([email protected])
Show file Open project: pmjones/php-framework-benchmarks

Protected Properties

Property Type Description
$accessDecisionManager
$accountChecker
$logger
$provider
$role
$securityContext
$usernameParameter

Public Methods

Method Description
__construct ( Symfony\Component\Security\SecurityContext $securityContext, Symfony\Component\Security\User\UserProviderInterface $provider, Symfony\Component\Security\User\AccountCheckerInterface $accountChecker, Symfony\Component\Security\Authorization\AccessDecisionManagerInterface $accessDecisionManager, Symfony\Component\HttpKernel\Log\LoggerInterface $logger = null, $usernameParameter = '_switch_user', $role = 'ROLE_ALLOWED_TO_SWITCH' ) Constructor.
handle ( Symfony\Component\EventDispatcher\Event $event ) Handles digest authentication.
register ( EventDispatcher $dispatcher, integer $priority )

Protected Methods

Method Description
attemptExitUser ( Request $request ) : Symfony\Component\Security\Authentication\Token\TokenInterface Attempts to exit from an already switched user.
attemptSwitchUser ( Request $request ) : Symfony\Component\Security\Authentication\Token\TokenInterface | null Attempts to switch to another user.
getOriginalToken ( Symfony\Component\Security\Authentication\Token\TokenInterface $token ) : Symfony\Component\Security\Authentication\Token\TokenInterface | false Gets the original Token from a switched one.

Method Details

__construct() public method

Constructor.
public __construct ( Symfony\Component\Security\SecurityContext $securityContext, Symfony\Component\Security\User\UserProviderInterface $provider, Symfony\Component\Security\User\AccountCheckerInterface $accountChecker, Symfony\Component\Security\Authorization\AccessDecisionManagerInterface $accessDecisionManager, Symfony\Component\HttpKernel\Log\LoggerInterface $logger = null, $usernameParameter = '_switch_user', $role = 'ROLE_ALLOWED_TO_SWITCH' )
$securityContext Symfony\Component\Security\SecurityContext
$provider Symfony\Component\Security\User\UserProviderInterface
$accountChecker Symfony\Component\Security\User\AccountCheckerInterface
$accessDecisionManager Symfony\Component\Security\Authorization\AccessDecisionManagerInterface
$logger Symfony\Component\HttpKernel\Log\LoggerInterface

attemptExitUser() protected method

Attempts to exit from an already switched user.
protected attemptExitUser ( Request $request ) : Symfony\Component\Security\Authentication\Token\TokenInterface
$request Symfony\Component\HttpFoundation\Request A Request instance
return Symfony\Component\Security\Authentication\Token\TokenInterface The original TokenInterface instance

attemptSwitchUser() protected method

Attempts to switch to another user.
protected attemptSwitchUser ( Request $request ) : Symfony\Component\Security\Authentication\Token\TokenInterface | null
$request Symfony\Component\HttpFoundation\Request A Request instance
return Symfony\Component\Security\Authentication\Token\TokenInterface | null The new TokenInterface if successfully switched, null otherwise

getOriginalToken() protected method

Gets the original Token from a switched one.
protected getOriginalToken ( Symfony\Component\Security\Authentication\Token\TokenInterface $token ) : Symfony\Component\Security\Authentication\Token\TokenInterface | false
$token Symfony\Component\Security\Authentication\Token\TokenInterface A switched TokenInterface instance
return Symfony\Component\Security\Authentication\Token\TokenInterface | false The original TokenInterface instance, false if the current TokenInterface is not switched

handle() public method

Handles digest authentication.
public handle ( Symfony\Component\EventDispatcher\Event $event )
$event Symfony\Component\EventDispatcher\Event An Event instance

register() public method

public register ( EventDispatcher $dispatcher, integer $priority )
$dispatcher Symfony\Component\EventDispatcher\EventDispatcher An EventDispatcher instance
$priority integer The priority

Property Details

$accessDecisionManager protected property

protected $accessDecisionManager

$accountChecker protected property

protected $accountChecker

$logger protected property

protected $logger

$provider protected property

protected $provider

$role protected property

protected $role

$securityContext protected property

protected $securityContext

$usernameParameter protected property

protected $usernameParameter