Removed default wording as there is no override

This commit is contained in:
Alex Bilbie
2016-01-17 14:23:18 +00:00
parent 0486d93fa3
commit 3d08051cbb
2 changed files with 11 additions and 11 deletions

View File

@@ -40,7 +40,7 @@ class ResourceServerMiddleware
return $exception->generateHttpResponse($response); return $exception->generateHttpResponse($response);
} }
$request = $this->server->getDefaultResponseType()->determineAccessTokenInHeader($request); $request = $this->server->getResponseType()->determineAccessTokenInHeader($request);
if ($request->getAttribute('oauth_access_token') === null) { if ($request->getAttribute('oauth_access_token') === null) {
$exception = OAuthServerException::accessDenied('Access token was invalid'); $exception = OAuthServerException::accessDenied('Access token was invalid');

View File

@@ -44,7 +44,7 @@ class Server implements EmitterAwareInterface
/** /**
* @var ResponseTypeInterface * @var ResponseTypeInterface
*/ */
protected $defaultResponseType; protected $responseType;
/** /**
* @var string * @var string
@@ -87,27 +87,27 @@ class Server implements EmitterAwareInterface
$this->clientRepository = $clientRepository; $this->clientRepository = $clientRepository;
$this->accessTokenRepository = $accessTokenRepository; $this->accessTokenRepository = $accessTokenRepository;
$this->scopeRepository = $scopeRepository; $this->scopeRepository = $scopeRepository;
$this->defaultResponseType = $responseType;
$this->privateKeyPath = $privateKeyPath; $this->privateKeyPath = $privateKeyPath;
$this->publicKeyPath = $publicKeyPath; $this->publicKeyPath = $publicKeyPath;
$this->responseType = $responseType;
} }
/** /**
* Get the default token type that grants will return * Get the token type that grants will return in the HTTP response
* *
* @return ResponseTypeInterface * @return ResponseTypeInterface
*/ */
public function getDefaultResponseType() public function getResponseType()
{ {
if (!$this->defaultResponseType instanceof ResponseTypeInterface) { if (!$this->responseType instanceof ResponseTypeInterface) {
$this->defaultResponseType = new BearerTokenResponse( $this->responseType = new BearerTokenResponse(
$this->defaultPrivateKeyPath, $this->privateKeyPath,
$this->defaultPublicKeyPath, $this->publicKeyPath,
$this->accessTokenRepository $this->accessTokenRepository
); );
} }
return $this->defaultResponseType; return $this->responseType;
} }
/** /**
@@ -130,7 +130,7 @@ class Server implements EmitterAwareInterface
$this->enabledGrantTypes[$grantType->getIdentifier()] = $grantType; $this->enabledGrantTypes[$grantType->getIdentifier()] = $grantType;
// Set grant response type // Set grant response type
$this->grantResponseTypes[$grantType->getIdentifier()] = $this->getDefaultResponseType(); $this->grantResponseTypes[$grantType->getIdentifier()] = $this->getResponseType();
// Set grant access token TTL // Set grant access token TTL
$this->grantTypeAccessTokenTTL[$grantType->getIdentifier()] = $accessTokenTTL; $this->grantTypeAccessTokenTTL[$grantType->getIdentifier()] = $accessTokenTTL;