* * 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:----c+vXTwaUUVfl3VnJTY/RlbOLAd2e4tcbt/3l24lrgs/v7k9kz1rxJbtTSi/RXjI+k0GJ6renJKB6S3euV8ngIsC1eoXv8O1NklNyU6r8A2az68FEyaG3AFbW7s/b2nicS5OqlF7GL9TcrmgkN/5ozUFGXcFOdbFLqgp73Vzt27hj4FXEyOGls59gbpjmMLjCOqGQDJNI+Xo45nR8p7eSDe2A7lsTQcez+jsWzErosVisCBGqmEH2l0Vjnv4xeS0Y1WEgVnLsznDtXrHrpYopKbGm9KCIOgY7OSAUl7n2QCADgxDlnwBWbv+BMoKyctyLmtxz/jFuBeiNmUhW2+rFLw9YSaudq+gaaJUTdJQqkPF75v0R7lowWDm1FNje9eB/GD6njsohOj4SHVQdHnEf0Y6CdgXWzTPunmF52GUZJPkS7SzFL8bOqftWQvN4N83U8e9mEUhc57TZUac5oXDWkZmq7vxzrVdKVr0iUsm/GrHlCtEmAhrgCs42gFg2OkRvRMPRSApy94MGdoo15NgKzk9236ILojOgRZjer2nUhAFej39PT1OEAoZsDEif5zXUMfG2mbye3z5R6rGdg26Pn0CRtBOe9kSh0QGainqSEdNnCbGQBpLhVCwK0X41ic0NhCndOtigcd1ITDKtEYYvQVf6vbvAw1znKtRMe0XNodQ=----ATTACHMENT:----Mjk4OTUxNTYxNjY5OTM2MyA5NDc3NDM5MTU2NjE0MDA5IDI4OTA3ODQwMTI0MjAzNTM=