mirror of
https://github.com/elyby/oauth2-server.git
synced 2024-12-28 07:50:23 +05:30
expires
isn't part of the spec
This commit is contained in:
parent
0d6c4f65b9
commit
54e6bbd4a6
@ -218,7 +218,6 @@ class AuthCodeGrant extends AbstractGrant
|
||||
}
|
||||
|
||||
$this->server->getTokenType()->set('access_token', $accessToken->getId());
|
||||
$this->server->getTokenType()->set('expires', $accessToken->getExpireTime());
|
||||
$this->server->getTokenType()->set('expires_in', $this->server->getAccessTokenTTL());
|
||||
|
||||
// Associate a refresh token if set
|
||||
|
@ -102,7 +102,6 @@ class ClientCredentialsGrant extends AbstractGrant
|
||||
$accessToken->save($this->server->getStorage('access_token'));
|
||||
|
||||
$this->server->getTokenType()->set('access_token', $accessToken->getId());
|
||||
$this->server->getTokenType()->set('expires', $accessToken->getExpireTime());
|
||||
$this->server->getTokenType()->set('expires_in', $this->server->getAccessTokenTTL());
|
||||
|
||||
return $this->server->getTokenType()->generateResponse();
|
||||
|
@ -137,7 +137,6 @@ class PasswordGrant extends AbstractGrant
|
||||
}
|
||||
|
||||
$this->server->getTokenType()->set('access_token', $accessToken->getId());
|
||||
$this->server->getTokenType()->set('expires', $accessToken->getExpireTime());
|
||||
$this->server->getTokenType()->set('expires_in', $this->server->getAccessTokenTTL());
|
||||
|
||||
// Associate a refresh token if set
|
||||
|
@ -132,7 +132,6 @@ class RefreshTokenGrant extends AbstractGrant
|
||||
$newAccessToken->save($this->server->getStorage('access_token'));
|
||||
|
||||
$this->server->getTokenType()->set('access_token', $newAccessToken->getId());
|
||||
$this->server->getTokenType()->set('expires', $newAccessToken->getExpireTime());
|
||||
$this->server->getTokenType()->set('expires_in', $this->server->getAccessTokenTTL());
|
||||
|
||||
// Expire the old refresh token
|
||||
|
@ -23,7 +23,6 @@ class Bearer extends AbstractTokenType implements TokenTypeInterface
|
||||
$return = [
|
||||
'access_token' => $this->get('access_token'),
|
||||
'token_type' => 'Bearer',
|
||||
'expires' => $this->get('expires'),
|
||||
'expires_in' => $this->get('expires_in')
|
||||
];
|
||||
|
||||
|
@ -402,7 +402,6 @@ class PasswordGrantTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertTrue(array_key_exists('access_token', $response));
|
||||
$this->assertTrue(array_key_exists('token_type', $response));
|
||||
$this->assertTrue(array_key_exists('expires_in', $response));
|
||||
$this->assertTrue(array_key_exists('expires', $response));
|
||||
}
|
||||
|
||||
public function testCompleteFlowRefreshToken()
|
||||
@ -470,6 +469,5 @@ class PasswordGrantTest extends \PHPUnit_Framework_TestCase
|
||||
// $this->assertTrue(array_key_exists('refresh_token', $response));
|
||||
$this->assertTrue(array_key_exists('token_type', $response));
|
||||
$this->assertTrue(array_key_exists('expires_in', $response));
|
||||
$this->assertTrue(array_key_exists('expires', $response));
|
||||
}
|
||||
}
|
||||
|
@ -11,7 +11,7 @@ use League\OAuth2\Server\Entity\RefreshTokenEntity;
|
||||
use League\OAuth2\Server\AuthorizationServer;
|
||||
use Mockery as M;
|
||||
|
||||
class RefreshTokenGreantTest extends \PHPUnit_Framework_TestCase
|
||||
class RefreshTokenGrantTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
public function testSetRefreshTokenTTL()
|
||||
{
|
||||
@ -212,7 +212,6 @@ class RefreshTokenGreantTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertTrue(array_key_exists('refresh_token', $response));
|
||||
$this->assertTrue(array_key_exists('token_type', $response));
|
||||
$this->assertTrue(array_key_exists('expires_in', $response));
|
||||
$this->assertTrue(array_key_exists('expires', $response));
|
||||
}
|
||||
|
||||
public function testCompleteFlowRequestScopes()
|
||||
@ -284,7 +283,6 @@ class RefreshTokenGreantTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertTrue(isset($response['refresh_token']));
|
||||
$this->assertTrue(isset($response['token_type']));
|
||||
$this->assertTrue(isset($response['expires_in']));
|
||||
$this->assertTrue(isset($response['expires']));
|
||||
}
|
||||
|
||||
public function testCompleteFlowRequestScopesInvalid()
|
||||
|
Loading…
Reference in New Issue
Block a user