Set a default scope for the authorization server

This commit is contained in:
Andrew Millington 2017-10-18 22:09:53 +01:00
parent c996b66528
commit 5a28fb8af4

View File

@ -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);