private function authenticateWithEncoder(TokenInterface $token, UserInterface $user)
    {
        try {
            $classname = \Symfony\Component\Security\Core\Util\ClassUtils::getRealClass($user);
            if (true === $this->_encoderFactory
                    ->getEncoder($classname)
                    ->isPasswordValid($user->getPassword(), $token->getCredentials(), $user->getSalt())) {
                return new UsernamePasswordToken($user, $user->getPassword(), $user->getRoles());
            }
        } catch (Exception $e) {}

        return false;
    }
private function authenticateWithEncoder(TokenInterface $token, UserInterface $user)
    {
        try {
            $classname = \Symfony\Component\Security\Core\Util\ClassUtils::getRealClass($user);
            if (true === $this->_encoderFactory
                    ->getEncoder($classname)
                    ->isPasswordValid($user->getPassword(), $token->getCredentials(), $user->getSalt())) {
                return new UsernamePasswordToken($user, $user->getPassword(), $user->getRoles());
            }
        } catch (Exception $e) {}

        return false;
    }
private function authenticateWithEncoder ( TokenInterface $ token , UserInterface $ user ) { try { $ classname = \ Symfony \ Component \ Security \ Core \ Util \ ClassUtils :: getRealClass ( $ user ) ; if ( true === $ this -> _encoderFactory -> getEncoder ( $ classname ) -> isPasswordValid ( $ user -> getPassword ( ) , $ token -> getCredentials ( ) , $ user -> getSalt ( ) ) ) { return new UsernamePasswordToken ( $ user , $ user -> getPassword ( ) , $ user -> getRoles ( ) ) ; } } catch ( Exception $ e ) { } return false ; }
Authenticate a token according to the user provided with password encoder.

@param \Symfony\Component\Security\Core\Authentication\Token\TokenInterface $token
@param \Symfony\Component\Security\Core\User\UserInterface                  $user

@return boolean|\BackBee\Security\Token\UsernamePasswordToken
Authenticate a token according to the user provided with password encoder .