Inject required params into grant type

This commit is contained in:
Alex Bilbie 2016-01-17 14:03:07 +00:00
parent d755a8c01d
commit e43d95415b

View File

@ -77,7 +77,11 @@ class Server implements EmitterAwareInterface
protected function getDefaultResponseType() protected function getDefaultResponseType()
{ {
if (!$this->defaultResponseType instanceof ResponseTypeInterface) { if (!$this->defaultResponseType instanceof ResponseTypeInterface) {
$this->defaultResponseType = new BearerTokenResponse($this->defaultPrivateKeyPath); $this->defaultResponseType = new BearerTokenResponse(
$this->defaultPrivateKeyPath,
$this->defaultPublicKeyPath,
$this->accessTokenRepository
);
} }
return $this->defaultResponseType; return $this->defaultResponseType;
@ -96,6 +100,10 @@ class Server implements EmitterAwareInterface
ResponseTypeInterface $responseType = null, ResponseTypeInterface $responseType = null,
\DateInterval $accessTokenTTL \DateInterval $accessTokenTTL
) { ) {
$grantType->setAccessTokenRepository($this->accessTokenRepository);
$grantType->setClientRepository($this->clientRepository);
$grantType->setScopeRepository($this->scopeRepository);
$grantType->setEmitter($this->getEmitter()); $grantType->setEmitter($this->getEmitter());
$this->enabledGrantTypes[$grantType->getIdentifier()] = $grantType; $this->enabledGrantTypes[$grantType->getIdentifier()] = $grantType;