From 5a28fb8af4503407de10c5b32f90c2a46ed87145 Mon Sep 17 00:00:00 2001 From: Andrew Millington Date: Wed, 18 Oct 2017 22:09:53 +0100 Subject: [PATCH] Set a default scope for the authorization server --- src/AuthorizationServer.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/AuthorizationServer.php b/src/AuthorizationServer.php index 46a9b27a..6da9c524 100644 --- a/src/AuthorizationServer.php +++ b/src/AuthorizationServer.php @@ -70,6 +70,11 @@ class AuthorizationServer implements EmitterAwareInterface */ private $encryptionKey; + /** + * @var string + */ + private $defaultScope; + /** * New server instance. * @@ -78,6 +83,7 @@ class AuthorizationServer implements EmitterAwareInterface * @param ScopeRepositoryInterface $scopeRepository * @param CryptKey|string $privateKey * @param string $encryptionKey + * @param null|string $defaultScope * @param null|ResponseTypeInterface $responseType */ public function __construct( @@ -86,6 +92,7 @@ class AuthorizationServer implements EmitterAwareInterface ScopeRepositoryInterface $scopeRepository, $privateKey, $encryptionKey, + $defaultScope = null, ResponseTypeInterface $responseType = null ) { $this->clientRepository = $clientRepository; @@ -97,6 +104,8 @@ class AuthorizationServer implements EmitterAwareInterface } $this->privateKey = $privateKey; + $this->defaultScope = $defaultScope; + $this->encryptionKey = $encryptionKey; $this->responseType = $responseType; } @@ -116,6 +125,7 @@ class AuthorizationServer implements EmitterAwareInterface $grantType->setAccessTokenRepository($this->accessTokenRepository); $grantType->setClientRepository($this->clientRepository); $grantType->setScopeRepository($this->scopeRepository); + $grantType->setDefaultScope($this->defaultScope); $grantType->setPrivateKey($this->privateKey); $grantType->setEmitter($this->getEmitter()); $grantType->setEncryptionKey($this->encryptionKey);