Добавлена поддержка для "внутренних" scopes, запросить которые во время oauth процесса нельзя

This commit is contained in:
ErickSkrauch
2016-12-09 23:42:07 +03:00
parent d85451567a
commit 213782ff62
7 changed files with 162 additions and 9 deletions

View File

@@ -12,7 +12,8 @@ class ScopeStorage extends AbstractStorage implements ScopeInterface {
* @inheritdoc
*/
public function get($scope, $grantType = null, $clientId = null) {
if (!in_array($scope, OauthScope::getScopes(), true)) {
$scopes = $grantType === 'authorization_code' ? OauthScope::getPublicScopes() : OauthScope::getScopes();
if (!in_array($scope, $scopes, true)) {
return null;
}