/Security/Authentication/Token/FacebookUserToken.php
http://github.com/FriendsOfSymfony/FOSFacebookBundle · PHP · 62 lines · 39 code · 15 blank · 8 comment · 1 complexity · 32ebe692b7482c8a8996dda743c49f89 MD5 · raw file
- <?php
- /*
- * This file is part of the FOSFacebookBundle package.
- *
- * (c) FriendsOfSymfony <http://friendsofsymfony.github.com/>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
- namespace FOS\FacebookBundle\Security\Authentication\Token;
- use Symfony\Component\Security\Core\Authentication\Token\AbstractToken;
- class FacebookUserToken extends AbstractToken
- {
- private $providerKey;
- protected $accessToken;
- public function __construct($providerKey, $uid = '', array $roles = array(), $accessToken = null)
- {
- parent::__construct($roles);
- $this->setUser($uid);
- if (!empty($uid)) {
- $this->setAuthenticated(true);
- }
- $this->providerKey = $providerKey;
- $this->accessToken = $accessToken;
- }
- public function getCredentials()
- {
- return '';
- }
- public function getProviderKey()
- {
- return $this->providerKey;
- }
- public function getAccessToken()
- {
- return $this->accessToken;
- }
- public function serialize()
- {
- return serialize(array($this->providerKey, parent::serialize()));
- }
- public function unserialize($str)
- {
- list($this->providerKey, $parentStr) = unserialize($str);
- parent::unserialize($parentStr);
- }
- }