Scheb\TwoFactorBundle\Security\TwoFactor\AuthenticationContextFactoryInterface::create PHP Метод

create() публичный Метод

public create ( Request $request, Symfony\Component\Security\Core\Authentication\Token\TokenInterface $token ) : Scheb\TwoFactorBundle\Security\TwoFactor\AuthenticationContextInterface
$request Symfony\Component\HttpFoundation\Request
$token Symfony\Component\Security\Core\Authentication\Token\TokenInterface
Результат Scheb\TwoFactorBundle\Security\TwoFactor\AuthenticationContextInterface
    public function create(Request $request, TokenInterface $token);

Usage Example

 /**
  * Listen for successful login events.
  *
  * @param InteractiveLoginEvent $event
  */
 public function onSecurityInteractiveLogin(InteractiveLoginEvent $event)
 {
     $request = $event->getRequest();
     // Skip two-factor authentication for whitelisted IPs
     if (in_array($request->getClientIp(), $this->ipWhitelist)) {
         return;
     }
     // Check if security token is supported
     $token = $event->getAuthenticationToken();
     if (!$this->isTokenSupported($token)) {
         return;
     }
     // Forward to two-factor providers
     // They decide if they will do two-factor authentication
     $context = $this->authenticationContextFactory->create($request, $token);
     $this->authHandler->beginAuthentication($context);
 }
All Usage Examples Of Scheb\TwoFactorBundle\Security\TwoFactor\AuthenticationContextFactoryInterface::create
AuthenticationContextFactoryInterface