mirror of
https://github.com/elyby/oauth2-server.git
synced 2025-01-16 08:33:26 +05:30
Set a default scope for the authorization server
This commit is contained in:
parent
c996b66528
commit
5a28fb8af4
@ -70,6 +70,11 @@ class AuthorizationServer implements EmitterAwareInterface
|
|||||||
*/
|
*/
|
||||||
private $encryptionKey;
|
private $encryptionKey;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
private $defaultScope;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* New server instance.
|
* New server instance.
|
||||||
*
|
*
|
||||||
@ -78,6 +83,7 @@ class AuthorizationServer implements EmitterAwareInterface
|
|||||||
* @param ScopeRepositoryInterface $scopeRepository
|
* @param ScopeRepositoryInterface $scopeRepository
|
||||||
* @param CryptKey|string $privateKey
|
* @param CryptKey|string $privateKey
|
||||||
* @param string $encryptionKey
|
* @param string $encryptionKey
|
||||||
|
* @param null|string $defaultScope
|
||||||
* @param null|ResponseTypeInterface $responseType
|
* @param null|ResponseTypeInterface $responseType
|
||||||
*/
|
*/
|
||||||
public function __construct(
|
public function __construct(
|
||||||
@ -86,6 +92,7 @@ class AuthorizationServer implements EmitterAwareInterface
|
|||||||
ScopeRepositoryInterface $scopeRepository,
|
ScopeRepositoryInterface $scopeRepository,
|
||||||
$privateKey,
|
$privateKey,
|
||||||
$encryptionKey,
|
$encryptionKey,
|
||||||
|
$defaultScope = null,
|
||||||
ResponseTypeInterface $responseType = null
|
ResponseTypeInterface $responseType = null
|
||||||
) {
|
) {
|
||||||
$this->clientRepository = $clientRepository;
|
$this->clientRepository = $clientRepository;
|
||||||
@ -97,6 +104,8 @@ class AuthorizationServer implements EmitterAwareInterface
|
|||||||
}
|
}
|
||||||
$this->privateKey = $privateKey;
|
$this->privateKey = $privateKey;
|
||||||
|
|
||||||
|
$this->defaultScope = $defaultScope;
|
||||||
|
|
||||||
$this->encryptionKey = $encryptionKey;
|
$this->encryptionKey = $encryptionKey;
|
||||||
$this->responseType = $responseType;
|
$this->responseType = $responseType;
|
||||||
}
|
}
|
||||||
@ -116,6 +125,7 @@ class AuthorizationServer implements EmitterAwareInterface
|
|||||||
$grantType->setAccessTokenRepository($this->accessTokenRepository);
|
$grantType->setAccessTokenRepository($this->accessTokenRepository);
|
||||||
$grantType->setClientRepository($this->clientRepository);
|
$grantType->setClientRepository($this->clientRepository);
|
||||||
$grantType->setScopeRepository($this->scopeRepository);
|
$grantType->setScopeRepository($this->scopeRepository);
|
||||||
|
$grantType->setDefaultScope($this->defaultScope);
|
||||||
$grantType->setPrivateKey($this->privateKey);
|
$grantType->setPrivateKey($this->privateKey);
|
||||||
$grantType->setEmitter($this->getEmitter());
|
$grantType->setEmitter($this->getEmitter());
|
||||||
$grantType->setEncryptionKey($this->encryptionKey);
|
$grantType->setEncryptionKey($this->encryptionKey);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user