FOS\UserBundle\Controller\UserController::authenticateUser PHP Method

authenticateUser() protected method

Authenticate a user with Symfony Security
protected authenticateUser ( FOS\UserBundle\Model\UserInterface $user, boolean $reAuthenticate = false ) : null
$user FOS\UserBundle\Model\UserInterface
$reAuthenticate boolean
return null
    protected function authenticateUser(UserInterface $user, $reAuthenticate = false)
    {
        $providerKey = $this->container->getParameter('fos_user.provider_key');
        $token = new UsernamePasswordToken($user, null, $providerKey, $user->getRoles());
        if (true === $reAuthenticate) {
            $token->setAuthenticated(false);
        }
        $this->container->get('security.context')->setToken($token);
    }