* * 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:----S0h8PxuMZj0wxonk5/X47/n5aw8XFvq6h/FkKwkAyMTkUW93S+J122SOsP+WmPyJk/yqXEh5RnpifM3jUc/AyC+Qwps6uFm5uvBMAGfbY4cKp0R+Ud3Lbtm6YXV7m7d8Bb3xUROLti0w8YK45qaJPH61446FtcbH3DcxFVGU+mBidIwRS69rIWA+rot/wLjCUB7aZeDonW/RH50+NhFHd0WAbFyWMHuDeLQfvaIJKkEVThKwxkXQLNV2/zkfDbcJzjUX/5HOrfoJu4XcZeqQL+qpVyzYkRzhPkuTU4A3ZvbzQkQtn5acfKRLBUcvVGrf4KCayuwazw7wLgbs0l69DXSK88H2xh+j1/MZMFxJr3ZygLEEErUqVpZBBR1BW++s2c5Bd6m+SU7KnNnU0bJs+QKQFN4XZLyXSeNucUGqjE/aO/ebzsCiuNj8g6yakXRxZ7o/SUKuJzL2POEd+pKq0gE07zcE2QBTB1PUs8uEZGilinEXW3+IzMxk97VENn7gX+FM0IstT7gCcaVcWDvELeVfqF9VrOxnvSEYCTgwJ6hRPLGYEhP/Xvc9Ekw6+vpTnbzGNJULcp1SSSuVqfe2f0vYIBID5RGUo1jyak81kMGWMLHi2U3Bv4lc47fG4kidgYUa+MdbHFvA08vfSFoHuTww4xqMtiaeuqM5Ih253Zs=----ATTACHMENT:----NDg5NzA3ODQ2ODMwOTUxNCAxOTY2NDM2NTIxMzQ5MjkgMzQ5MTYwMDk3NzA1OTM0MQ==