PHP Class Scheb\TwoFactorBundle\Security\TwoFactor\Provider\TwoFactorProviderRegistry

Inheritance: implements Scheb\TwoFactorBundle\Security\TwoFactor\AuthenticationHandlerInterface
Show file Open project: scheb/two-factor-bundle Class Usage Examples

Public Methods

Method Description
__construct ( SessionFlagManager $flagManager, Symfony\Component\EventDispatcher\EventDispatcherInterface $eventDispatcher, string $authRequestParameter, array $providers = [] ) Initialize with an array of registered two-factor providers.
beginAuthentication ( Scheb\TwoFactorBundle\Security\TwoFactor\AuthenticationContextInterface $context ) Iterate over two-factor providers and begin the two-factor authentication process.
requestAuthenticationCode ( Scheb\TwoFactorBundle\Security\TwoFactor\AuthenticationContextInterface $context ) : Response | null Iterate over two-factor providers and ask for two-factor authentication.

Method Details

__construct() public method

Initialize with an array of registered two-factor providers.
public __construct ( SessionFlagManager $flagManager, Symfony\Component\EventDispatcher\EventDispatcherInterface $eventDispatcher, string $authRequestParameter, array $providers = [] )
$flagManager Scheb\TwoFactorBundle\Security\TwoFactor\Session\SessionFlagManager
$eventDispatcher Symfony\Component\EventDispatcher\EventDispatcherInterface
$authRequestParameter string
$providers array

beginAuthentication() public method

Iterate over two-factor providers and begin the two-factor authentication process.
public beginAuthentication ( Scheb\TwoFactorBundle\Security\TwoFactor\AuthenticationContextInterface $context )
$context Scheb\TwoFactorBundle\Security\TwoFactor\AuthenticationContextInterface

requestAuthenticationCode() public method

Each provider can return a response. The first response will be returned.
public requestAuthenticationCode ( Scheb\TwoFactorBundle\Security\TwoFactor\AuthenticationContextInterface $context ) : Response | null
$context Scheb\TwoFactorBundle\Security\TwoFactor\AuthenticationContextInterface
return Symfony\Component\HttpFoundation\Response | null