mirror of
https://github.com/elyby/oauth2-server.git
synced 2024-11-01 16:33:07 +05:30
Updated implicit grant
This commit is contained in:
parent
b9570ac6b0
commit
2866185349
@ -87,22 +87,14 @@ class Implict implements GrantTypeInterface {
|
||||
$accessTokenExpires = time() + $this->authServer->getExpiresIn();
|
||||
|
||||
// Create a new session
|
||||
$sessionId = $this->authServer->getStorage('session')->createSession(
|
||||
$authParams['client_id'],
|
||||
$authParams['redirect_uri'],
|
||||
'user',
|
||||
$authParams['user_id'],
|
||||
null,
|
||||
$accessToken,
|
||||
null,
|
||||
$accessTokenExpires,
|
||||
'granted'
|
||||
);
|
||||
$sessionId = $this->authServer->getStorage('session')->createSession($authParams['client_id'], 'user', $authParams['user_id']);
|
||||
|
||||
// Associate scopes with the new session
|
||||
foreach ($authParams['scopes'] as $scope)
|
||||
{
|
||||
$this->authServer->getStorage('session')->associateScope($sessionId, $scope['id']);
|
||||
// Create an access token
|
||||
$accessTokenId = $this->authServer->getStorage('session')->associateAccessToken($sessionId, $accessToken, $accessTokenExpires);
|
||||
|
||||
// Associate scopes with the access token
|
||||
foreach ($authParams['scopes'] as $scope) {
|
||||
$this->authServer->getStorage('session')->associateScope($accessTokenId, $scope['id']);
|
||||
}
|
||||
|
||||
$response = array(
|
||||
@ -111,6 +103,5 @@ class Implict implements GrantTypeInterface {
|
||||
|
||||
return $response;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user