mirror of
https://github.com/elyby/oauth2-server.git
synced 2025-01-09 21:37:59 +05:30
Altered associateScope logic
This commit is contained in:
parent
7373f312da
commit
ba2dc90f3b
@ -253,7 +253,8 @@ class AuthCode implements GrantTypeInterface {
|
|||||||
throw new Exception\ClientException(sprintf($this->authServer->getExceptionMessage('invalid_grant'), 'code'), 9);
|
throw new Exception\ClientException(sprintf($this->authServer->getExceptionMessage('invalid_grant'), 'code'), 9);
|
||||||
}
|
}
|
||||||
|
|
||||||
// A session ID was returned so update it with an access token and remove the authorisation code
|
// Get any associated scopes
|
||||||
|
$scopes = $this->authServer->getStorage('session')->getAuthCodeScopes($authCodeDetails['authcode_id']);
|
||||||
|
|
||||||
// A session ID was returned so update it with an access token and remove the authorisation code
|
// A session ID was returned so update it with an access token and remove the authorisation code
|
||||||
$accessToken = SecureKey::make();
|
$accessToken = SecureKey::make();
|
||||||
@ -267,11 +268,9 @@ class AuthCode implements GrantTypeInterface {
|
|||||||
$accessTokenId = $this->authServer->getStorage('session')->associateAccessToken($authCodeDetails['session_id'], $accessToken, $accessTokenExpires);
|
$accessTokenId = $this->authServer->getStorage('session')->associateAccessToken($authCodeDetails['session_id'], $accessToken, $accessTokenExpires);
|
||||||
|
|
||||||
// Associate scopes with the access token
|
// Associate scopes with the access token
|
||||||
if ( ! is_null($session['scope_ids'])) {
|
if (count($scopes) > 0) {
|
||||||
$scopeIds = explode(',', $session['scope_ids']);
|
foreach ($scopes as $scope) {
|
||||||
|
$this->authServer->getStorage('session')->associateScope($accessTokenId, $scope['scope_id']);
|
||||||
foreach ($scopeIds as $scopeId) {
|
|
||||||
$this->authServer->getStorage('session')->associateScope($accessTokenId, $scopeId);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user