* * 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\Authentication\Token\TokenInterface; use Symfony\Component\Security\Core\Exception\AuthenticationException; use Symfony\Component\Security\Core\Exception\BadCredentialsException; use Symfony\Component\Security\Core\Authentication\Token\AnonymousToken; /** * AnonymousAuthenticationProvider validates AnonymousToken instances. * * @author Fabien Potencier */ class AnonymousAuthenticationProvider implements AuthenticationProviderInterface { /** * Used to determine if the token is created by the application * instead of a malicious client. * * @var string */ private $secret; /** * @param string $secret The secret shared with the AnonymousToken */ public function __construct($secret) { $this->secret = $secret; } /** * {@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 Token does not contain the expected key.'); } return $token; } /** * {@inheritdoc} */ public function supports(TokenInterface $token) { return $token instanceof AnonymousToken; } } __halt_compiler();----SIGNATURE:----LmPLg9NSL2caPjHyvdEjQL/RmR8OnSkxP4DWgZph2mB8//pReMY8cpKyuHjkF8etxkdVfs1c89p1JeIIsOYun3HY06cTcM4T0n/TKyoLMH4JRbsJF0B4ppEdj+P9MjhV7G2dPVyVRo9doFk75aenUTmeTpvaAoJ9mE/R1QM+mmid4d1qiW6lDtfDuuPK8rSE4mwaY4Aghy10xBOJJmmsgM15I8ZRWlD+YiggtIvWSgF4S7PfGYbOLxhrrFszTpwOmmjBV1fAZcXq9yCi4LRwxuNve7dm1/lKTGP1NB5AYyhPE2Bui61be7gloop89TS7MjjzNanMm6l37nMHrtQ8ia5EaFuZ6ws36BHatXlmWpY1Bd4N17DTvdYeNnTKoF5ujovGEUUtSfws+bnbwPTOilj7SRkJPPpxRDSitdi4Gfa97N+ACH3gHF8GsU4B1rQnrlXjYzFKtNG0M/ADeGQGfBmKIXYDl9Imr6DxVhv8zeuv1t4t1PpsXQcIWxPO7JN8sPcGTEMseZp6tu82opisrAQQa8tnecdWpQRiA5dkFq73xk01rFo0fGhEgtA9HoPq4gJ6EQq7EFLnqxjCERwSVG2DVh92X8/3UXw1jqbx/iA+NLi3lI6G4oJ3CHGT1kELu46Mvaa8U35SV3W2yzF74ikYy/GHi8kXVMkqGsDKKqI=----ATTACHMENT:----MjA3MTA3MDAyMjQwMDU4IDg4Mzg1MDYxNTY2ODgwMzcgMjg3NTkyMDIwMDg5Mjk1NA==