* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Security\Core\Authentication\Provider; use Symfony\Component\Security\Core\User\UserCheckerInterface; use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; use Symfony\Component\Security\Core\Authentication\Token\RememberMeToken; use Symfony\Component\Security\Core\Exception\AuthenticationException; use Symfony\Component\Security\Core\Exception\BadCredentialsException; class RememberMeAuthenticationProvider implements AuthenticationProviderInterface { private $userChecker; private $secret; private $providerKey; /** * @param UserCheckerInterface $userChecker An UserCheckerInterface interface * @param string $secret A secret * @param string $providerKey A provider secret */ public function __construct(UserCheckerInterface $userChecker, $secret, $providerKey) { $this->userChecker = $userChecker; $this->secret = $secret; $this->providerKey = $providerKey; } /** * {@inheritdoc} */ public function authenticate(TokenInterface $token) { if (!$this->supports($token)) { throw new AuthenticationException('The token is not supported by this authentication provider.'); } if ($this->secret !== $token->getSecret()) { throw new BadCredentialsException('The presented secret does not match.'); } $user = $token->getUser(); $this->userChecker->checkPreAuth($user); $this->userChecker->checkPostAuth($user); $authenticatedToken = new RememberMeToken($user, $this->providerKey, $this->secret); $authenticatedToken->setAttributes($token->getAttributes()); return $authenticatedToken; } /** * {@inheritdoc} */ public function supports(TokenInterface $token) { return $token instanceof RememberMeToken && $token->getProviderKey() === $this->providerKey; } } __halt_compiler();----SIGNATURE:----qUTwErj94UA+O8W+rcASRL2Rf03iPlo/xi2AvIjTPBXyw8kNc8oj+HjOFAtCFwuLM/QF5bXV3P/SEm3lZlRChrtCurRnNloCVu7krWoLCXiYs06hitEEkS+7UgzcN9uGDcOt9SaNSEuAih1g8Eixcm2te/9Ty9iyv00eFeIdfzFgd8mseKeJStUTr71xqJwpKe0/OmotPWOwB8KGeMa4l3csByEPi6nk6e6mErUeh21M39YfQgDt8I62JJ+4JSVbDiIQny898GQ9F99pWZ13/AI5FIt7wrJ3Pki7g8iPh5t3pLPD02/Bz8PBIrbndyTtY8pU4fbQRzNfVMRh2bwpLUY8t5TbUdLCfLpgJZ/0tJHzw8OJHYP/88x2CYZIIOJsLvMP7bpBv7F6vKjqwdELDOEmU/vpMaTfSORZUEotWiNIQBvTvdpui0eh6Lxe3JSCHSCFfZBUhzecsc4wLs5l1nX9j3YewBCq4AHtGQdgxJh7x5Cwv83pT5yJmG8zdcKbW8qAi8bAZy1IJKAJr9M093dN1tFSh0qHzEXXVj1Z9ZOBursZWsLH6GTOK2FQQ4655CEDvT9ffelKiSA/gkmDKDqrKzlO0TPgX69aDmrBDZDVHF084WNdu6r63MmDN49/Yi2EUnBkQqoA5lCTwzHOSdawYh2V8XkB1dTI7gJEFD4=----ATTACHMENT:----MTkwOTExMzE3NzU2NjM5MiAzNjkwNzI3NjY1MTc0ODI5IDEwMDUwMDk2NDc2MTgzNA==