PHP Class Scheb\TwoFactorBundle\Security\TwoFactor\Session\SessionFlagManager

Show file Open project: scheb/two-factor-bundle Class Usage Examples

Protected Properties

Property Type Description
$flagGenerator Scheb\TwoFactorBundle\Security\TwoFactor\Session\SessionFlagGenerator
$session Symfony\Component\HttpFoundation\Session\SessionInterface

Public Methods

Method Description
__construct ( Symfony\Component\HttpFoundation\Session\SessionInterface $session, Scheb\TwoFactorBundle\Security\TwoFactor\Session\SessionFlagGenerator $flagGenerator ) Construct a manager that takes care of session flags.
isNotAuthenticated ( string $provider, Symfony\Component\Security\Core\Authentication\Token\TokenInterface $token ) : boolean Check if session flag is set and is not complete.
setBegin ( string $provider, Symfony\Component\Security\Core\Authentication\Token\TokenInterface $token ) Set session flag to ask for two-factor authentication.
setComplete ( string $provider, Symfony\Component\Security\Core\Authentication\Token\TokenInterface $token ) Set session flag completed.

Protected Methods

Method Description
getSessionFlag ( string $provider, Symfony\Component\Security\Core\Authentication\Token\TokenInterface $token ) : string Generate session token.

Method Details

__construct() public method

Construct a manager that takes care of session flags.
public __construct ( Symfony\Component\HttpFoundation\Session\SessionInterface $session, Scheb\TwoFactorBundle\Security\TwoFactor\Session\SessionFlagGenerator $flagGenerator )
$session Symfony\Component\HttpFoundation\Session\SessionInterface
$flagGenerator Scheb\TwoFactorBundle\Security\TwoFactor\Session\SessionFlagGenerator

getSessionFlag() protected method

Generate session token.
protected getSessionFlag ( string $provider, Symfony\Component\Security\Core\Authentication\Token\TokenInterface $token ) : string
$provider string Two-factor provider name
$token Symfony\Component\Security\Core\Authentication\Token\TokenInterface
return string

isNotAuthenticated() public method

Check if session flag is set and is not complete.
public isNotAuthenticated ( string $provider, Symfony\Component\Security\Core\Authentication\Token\TokenInterface $token ) : boolean
$provider string
$token Symfony\Component\Security\Core\Authentication\Token\TokenInterface
return boolean

setBegin() public method

Set session flag to ask for two-factor authentication.
public setBegin ( string $provider, Symfony\Component\Security\Core\Authentication\Token\TokenInterface $token )
$provider string
$token Symfony\Component\Security\Core\Authentication\Token\TokenInterface

setComplete() public method

Set session flag completed.
public setComplete ( string $provider, Symfony\Component\Security\Core\Authentication\Token\TokenInterface $token )
$provider string
$token Symfony\Component\Security\Core\Authentication\Token\TokenInterface

Property Details

$flagGenerator protected property

protected SessionFlagGenerator,Scheb\TwoFactorBundle\Security\TwoFactor\Session $flagGenerator
return Scheb\TwoFactorBundle\Security\TwoFactor\Session\SessionFlagGenerator

$session protected property

protected SessionInterface,Symfony\Component\HttpFoundation\Session $session
return Symfony\Component\HttpFoundation\Session\SessionInterface