* * 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\Token; use Symfony\Component\Security\Core\Role\Role; /** * AnonymousToken represents an anonymous token. * * @author Fabien Potencier */ class AnonymousToken extends AbstractToken { private $secret; /** * @param string $secret A secret used to make sure the token is created by the app and not by a malicious client * @param string|object $user The user can be a UserInterface instance, or an object implementing a __toString method or the username as a regular string * @param Role[] $roles An array of roles */ public function __construct($secret, $user, array $roles = array()) { parent::__construct($roles); $this->secret = $secret; $this->setUser($user); $this->setAuthenticated(true); } /** * {@inheritdoc} */ public function getCredentials() { return ''; } /** * Returns the secret. * * @return string */ public function getSecret() { return $this->secret; } /** * {@inheritdoc} */ public function serialize() { return serialize(array($this->secret, parent::serialize())); } /** * {@inheritdoc} */ public function unserialize($serialized) { list($this->secret, $parentStr) = unserialize($serialized); parent::unserialize($parentStr); } } __halt_compiler();----SIGNATURE:----BXGMatqUwdTUpT4u+ZlatlOEwPS+wcvBB2zd78htTRWSC1FbGl5R42F4QX4A1k4WwHIA/8stuDADzT78VbDU0C78y5DdqJm9fjIK8DNHJV+YkItTw8YgxnWmaDhmgqCr8gEunZxcVZIDKN93qZlDx14sblGtMzwdA6++FOngvRDEv4/HbSarwZEl2gx+pkn0yqII4UBOCZ9uLuC79s8433/Q5kfeHpd7GJ3KnNuXJT43XmIcLy9l703gGtx6LWISdznu2dLugXAba5vfP41vTSz1EUnpauNay/Q6jjEsNTntcNiVcxpvmocZHfB5YHlocK7A4isDLBES9rYoe7EBt95uF7i1h7Njd6D3IovI4+1UqbPJSkyvSvT7L3MYCEwjApjKEGQBhddKl69e4nl2dM3NYHVjZs7FDnqy/rKDnaEk4yNetl9YuE6bklm8ry+jF2qISC3yLY1dt4Xo16FUFmOEjg1EIAwcoLcb/gJkiYh4jfbaWANIcdL190XJhXGQlIPpAAyuJafnx1pM5nBNsTFw2cnsxwNKSwZpIoq7T4iWrUNiN5prt4VvGGmvv91ftId/aBUWs0NhmDlDGpZNIx14ZvMGygytdIywFflHMjPPYDYsvoNF+KzdKBzhRO+J1PoEHP132DWSsoiDC9l5nL8kMXzu6591ZkQ7qJxmc4c=----ATTACHMENT:----MjUzMDI1Nzc5NDU4MDYwNyA2NTU5MjM4MjE5NzU1ODIwIDM2MDc0NTQ4OTg1ODE2OTI=