Skip to content

Instantly share code, notes, and snippets.

@DavidOndrus
Created May 21, 2018 05:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DavidOndrus/b8a7c011492821c66bf69a855f4af751 to your computer and use it in GitHub Desktop.
Save DavidOndrus/b8a7c011492821c66bf69a855f4af751 to your computer and use it in GitHub Desktop.
updated RefreshTokenGrant.php:respondToAccessTokenRequest
$newScopes = array();
$newScopesIdentifiers = array();
foreach ($scopes as $scope) {
if (in_array($scope->getIdentifier(), $oldRefreshToken['scopes'])) {
array_push($newScopes, $scope);
array_push($newScopesIdentifiers, $scope->getIdentifier());
}
}
...
$accessToken = $this->issueAccessToken($accessTokenTTL, $client, $oldRefreshToken['user_id'], $newScopes);
...
$responseType->setTokenScopes($newScopesIdentifiers);
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment