* * 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:----tTzIOlCuqUmy4aV1u8nFCpx+JNhOTK0BBlwf/u+LrvVrPxXzY5zv5RIMDRydmVG4UUu3fNTwARq2mHMrIAY6DBPfUQYmVJJDXi6r0RKXwbQzcUzwn0izyYdHuSgHnm5L3i8N9mxJG6AM+VdSs5vbRbMDcP6lPAmbjPrTUhfxxIrgNRgyTRU9a+MYte02IMjv/gA+hAUEMFzq5GhlfOg51t0rSpG6sHs9fb22CMTTYL6BN2QBcRvqeL9r4Sj0ubN4YMEvoeGrL8OJUtaeQnswub+T2QV8N59RlZI4Mwr5nMnbkbaFg0phPt3oniozCb2kNYmA6Dd1Az8kJCVmdmdVA5HV+SZaemzTGj3k/oa/7cNz8V7VxICTOWzrfQXbEJF4Sq93C18BqgnNk7cy9e3ZULGN4LqWmUdYV1gY+vMLbcxfLXy4uqnrnpgst5KBpOpT0vGiMl6qFDR065etfi81S45bnHxkmu55hKRyTZteI6/FcIplSbRnsqWW1L3t+qqd98V4nPIQT9AnxfSptFAZL4flvsHdW4BXSMSbQ5/hMH5vjZeHijJmo9oQ9B0DXXIUaT242zBfqYLErVaiHohNODmqxR1pnReugPXyzf/1z4LgkKLeqgOEyUTiT4ZxHEEzFVpgzE5ZO/1DGZMbzzhQ7Brs8lu1WrySmMeFAEqXwUE=----ATTACHMENT:----ODMzMzU1MjQxNzk0OTQ4NyAxNzQwMTAwMjEwODM1Mjg1IDgwMjcyNjQ5OTAwMDk5MjI=