From e43d95415bd8b69934df7c269b76468cc66c473b Mon Sep 17 00:00:00 2001 From: Alex Bilbie Date: Sun, 17 Jan 2016 14:03:07 +0000 Subject: [PATCH] Inject required params into grant type --- src/Server.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Server.php b/src/Server.php index ba4efd0d..f0df7d61 100644 --- a/src/Server.php +++ b/src/Server.php @@ -77,7 +77,11 @@ class Server implements EmitterAwareInterface protected function getDefaultResponseType() { if (!$this->defaultResponseType instanceof ResponseTypeInterface) { - $this->defaultResponseType = new BearerTokenResponse($this->defaultPrivateKeyPath); + $this->defaultResponseType = new BearerTokenResponse( + $this->defaultPrivateKeyPath, + $this->defaultPublicKeyPath, + $this->accessTokenRepository + ); } return $this->defaultResponseType; @@ -96,6 +100,10 @@ class Server implements EmitterAwareInterface ResponseTypeInterface $responseType = null, \DateInterval $accessTokenTTL ) { + $grantType->setAccessTokenRepository($this->accessTokenRepository); + $grantType->setClientRepository($this->clientRepository); + $grantType->setScopeRepository($this->scopeRepository); + $grantType->setEmitter($this->getEmitter()); $this->enabledGrantTypes[$grantType->getIdentifier()] = $grantType;