oauth2-server/src/League/OAuth2/Server/Entities/RefreshToken.php
2013-12-24 17:01:11 +00:00

62 lines
1.4 KiB
PHP

<?php
namespace League\OAuth2\Server\Entities;
use League\OAuth2\Server\Storage\SessionStorageInterface;
use League\OAuth2\Server\Storage\RefreshTokenInterface;
use Symfony\Component\HttpFoundation\ParameterBag;
use League\OAuth2\Server\Util\SecureKey;
use League\OAuth2\Server\Exception\InvalidAccessTokenException;
class RefreshToken extends AbstractToken
{
protected $accessToken;
/**
* __construct
* @param RefreshTokenInterface $storage
* @return self
*/
public function __construct(RefreshTokenInterface $storage)
{
parent::__construct($storage);
}
/**
* Associate an access token
* @param AccessToken $accessToken
* @return self
*/
public function setAccessToken(AccessToken $accessToken)
{
$this->accessToken = $accessToken;
return $this;
}
/**
* Return access token
* @return AccessToken
*/
public function getAccessToken()
{
return $this->accessToken;
}
/**
* (@inheritdoc)
*/
public function save()
{
/*$this->getStorage()->createAccessToken(
$this->getId(),
$this->getExpireTime(),
$this->getAccessToken()->getId()
);
// Associate the scope with the token
foreach ($this->getScopes() as $scope) {
$this->getStorage()->associateScope($this->getId(), $scope->getId());
}*/
}
}