support grant specific access token ttl

This commit is contained in:
pulkit
2014-09-11 13:39:50 +01:00
parent 9e2a6ed238
commit 1ff3d1adda
6 changed files with 21 additions and 13 deletions

View File

@@ -94,7 +94,7 @@ class ClientCredentialsGrant extends AbstractGrant
// Generate an access token
$accessToken = new AccessTokenEntity($this->server);
$accessToken->setId(SecureKey::generate());
$accessToken->setExpireTime($this->server->getAccessTokenTTL() + time());
$accessToken->setExpireTime($this->getAccessTokenTTL() + time());
// Associate scopes with the session and access token
foreach ($scopes as $scope) {
@@ -111,7 +111,7 @@ class ClientCredentialsGrant extends AbstractGrant
$accessToken->save($this->server->getStorage('access_token'));
$this->server->getTokenType()->set('access_token', $accessToken->getId());
$this->server->getTokenType()->set('expires_in', $this->server->getAccessTokenTTL());
$this->server->getTokenType()->set('expires_in', $this->getAccessTokenTTL());
return $this->server->getTokenType()->generateResponse();
}