Scheb\TwoFactorBundle\Security\TwoFactor\AuthenticationHandlerInterface::beginAuthentication PHP Method

beginAuthentication() public method

Begin the two-factor authentication process.
public beginAuthentication ( Scheb\TwoFactorBundle\Security\TwoFactor\AuthenticationContextInterface $context )
$context Scheb\TwoFactorBundle\Security\TwoFactor\AuthenticationContextInterface
    public function beginAuthentication(AuthenticationContextInterface $context);

Usage Example

 /**
  * Check if user is on a trusted computer, otherwise call TwoFactorProviderRegistry.
  *
  * @param AuthenticationContextInterface $context
  */
 public function beginAuthentication(AuthenticationContextInterface $context)
 {
     $request = $context->getRequest();
     $user = $context->getUser();
     $context->setUseTrustedOption($this->useTrustedOption);
     // Skip two-factor authentication on trusted computers
     if ($context->useTrustedOption() && $this->cookieManager->isTrustedComputer($request, $user)) {
         return;
     }
     $this->authHandler->beginAuthentication($context);
 }
All Usage Examples Of Scheb\TwoFactorBundle\Security\TwoFactor\AuthenticationHandlerInterface::beginAuthentication