PHP Class Elcodi\Admin\UserBundle\Security\OneTimeLoginAuthenticator

Inheritance: implements Symfony\Component\Security\Core\Authentication\SimplePreAuthenticatorInterface
Show file Open project: elcodi/bamboo

Public Methods

Method Description
__construct ( Doctrine\Common\Persistence\ObjectManager $adminUserObjectManager, Elcodi\Component\User\Repository\AdminUserRepository $adminUserRepository ) Generates a new OneTimeLoginAuthenticator injecting it's dependencies.
authenticateToken ( Symfony\Component\Security\Core\Authentication\Token\TokenInterface $token, Symfony\Component\Security\Core\User\UserProviderInterface $userProvider, string $providerKey ) : PreAuthenticatedToken Authenticate the received token and returns an authenticated token.
createToken ( Request $request, string $providerKey ) : PreAuthenticatedToken Creates a token with the login key received on the query parameter.
supportsToken ( Symfony\Component\Security\Core\Authentication\Token\TokenInterface $token, string $providerKey ) : boolean Checks if the received token is a pre authenticated token.

Method Details

__construct() public method

Generates a new OneTimeLoginAuthenticator injecting it's dependencies.
public __construct ( Doctrine\Common\Persistence\ObjectManager $adminUserObjectManager, Elcodi\Component\User\Repository\AdminUserRepository $adminUserRepository )
$adminUserObjectManager Doctrine\Common\Persistence\ObjectManager The admin user manager object.
$adminUserRepository Elcodi\Component\User\Repository\AdminUserRepository The Admin user repository object.

authenticateToken() public method

Authenticate the received token and returns an authenticated token.
public authenticateToken ( Symfony\Component\Security\Core\Authentication\Token\TokenInterface $token, Symfony\Component\Security\Core\User\UserProviderInterface $userProvider, string $providerKey ) : PreAuthenticatedToken
$token Symfony\Component\Security\Core\Authentication\Token\TokenInterface The token generated with the login key.
$userProvider Symfony\Component\Security\Core\User\UserProviderInterface A user provider.
$providerKey string The security providerKey (The firewall security area)
return Symfony\Component\Security\Core\Authentication\Token\PreAuthenticatedToken A pre-authenticated token generated using the user admin entity.

createToken() public method

Creates a token with the login key received on the query parameter.
public createToken ( Request $request, string $providerKey ) : PreAuthenticatedToken
$request Symfony\Component\HttpFoundation\Request The current request.
$providerKey string The security providerKey (The firewall security area)
return Symfony\Component\Security\Core\Authentication\Token\PreAuthenticatedToken A pre-authenticated token with the login key received.

supportsToken() public method

Checks if the received token is a pre authenticated token.
public supportsToken ( Symfony\Component\Security\Core\Authentication\Token\TokenInterface $token, string $providerKey ) : boolean
$token Symfony\Component\Security\Core\Authentication\Token\TokenInterface The token received.
$providerKey string The security providerKey (The firewall security area)
return boolean Returns true if the received token is of the expected type and for the provider key we are using.