This commit is contained in:
Alex Bilbie 2014-08-18 16:47:36 +01:00
parent b9e12a7fec
commit 7d8989a8cd
3 changed files with 14 additions and 4 deletions

View File

@ -223,6 +223,10 @@ class AuthCodeGrant extends AbstractGrant
$session->associateScope($authCodeScope);
}
foreach ($session->getScopes() as $scope) {
$accessToken->associateScope($scope);
}
$this->server->getTokenType()->set('access_token', $accessToken->getId());
$this->server->getTokenType()->set('expires_in', $this->server->getAccessTokenTTL());

View File

@ -98,10 +98,13 @@ class ClientCredentialsGrant extends AbstractGrant
// Associate scopes with the session and access token
foreach ($scopes as $scope) {
$accessToken->associateScope($scope);
$session->associateScope($scope);
}
foreach ($session->getScopes() as $scope) {
$accessToken->associateScope($scope);
}
// Save everything
$session->save($this->server->getStorage('session'));
$accessToken->setSession($session);

View File

@ -138,10 +138,13 @@ class PasswordGrant extends AbstractGrant
// Associate scopes with the session and access token
foreach ($scopes as $scope) {
$accessToken->associateScope($scope);
$session->associateScope($scope);
}
foreach ($session->getScopes() as $scope) {
$accessToken->associateScope($scope);
}
$this->server->getTokenType()->set('access_token', $accessToken->getId());
$this->server->getTokenType()->set('expires_in', $this->server->getAccessTokenTTL());