mirror of
https://github.com/elyby/oauth2-server.git
synced 2024-11-15 17:56:14 +05:30
Updated client credentials grant
This commit is contained in:
parent
6751c4d2fe
commit
4034bea6d1
@ -134,22 +134,15 @@ class ClientCredentials implements GrantTypeInterface {
|
|||||||
$this->authServer->getStorage('session')->deleteSession($authParams['client_id'], 'client', $authParams['client_id']);
|
$this->authServer->getStorage('session')->deleteSession($authParams['client_id'], 'client', $authParams['client_id']);
|
||||||
|
|
||||||
// Create a new session
|
// Create a new session
|
||||||
$sessionId = $this->authServer->getStorage('session')->createSession(
|
$sessionId = $this->authServer->getStorage('session')->createSession($authParams['client_id'], 'client', $authParams['client_id']);
|
||||||
$authParams['client_id'],
|
|
||||||
null,
|
// Add the access token
|
||||||
'client',
|
$accessTokenId = $this->authServer->getStorage('session')->associateAccessToken($sessionId, $accessToken);
|
||||||
$authParams['client_id'],
|
|
||||||
null,
|
|
||||||
$accessToken,
|
|
||||||
null,
|
|
||||||
$accessTokenExpires,
|
|
||||||
'granted'
|
|
||||||
);
|
|
||||||
|
|
||||||
// Associate scopes with the new session
|
// Associate scopes with the new session
|
||||||
foreach ($authParams['scopes'] as $scope)
|
foreach ($authParams['scopes'] as $scope)
|
||||||
{
|
{
|
||||||
$this->authServer->getStorage('session')->associateScope($sessionId, $scope['id']);
|
$this->authServer->getStorage('session')->associateScope($accessTokenId, $scope['id']);
|
||||||
}
|
}
|
||||||
|
|
||||||
$response = array(
|
$response = array(
|
||||||
|
Loading…
Reference in New Issue
Block a user