mirror of
https://github.com/elyby/oauth2-server.git
synced 2024-11-01 16:33:07 +05:30
Removed default wording as there is no override
This commit is contained in:
parent
0486d93fa3
commit
3d08051cbb
@ -40,7 +40,7 @@ class ResourceServerMiddleware
|
||||
return $exception->generateHttpResponse($response);
|
||||
}
|
||||
|
||||
$request = $this->server->getDefaultResponseType()->determineAccessTokenInHeader($request);
|
||||
$request = $this->server->getResponseType()->determineAccessTokenInHeader($request);
|
||||
|
||||
if ($request->getAttribute('oauth_access_token') === null) {
|
||||
$exception = OAuthServerException::accessDenied('Access token was invalid');
|
||||
|
@ -44,7 +44,7 @@ class Server implements EmitterAwareInterface
|
||||
/**
|
||||
* @var ResponseTypeInterface
|
||||
*/
|
||||
protected $defaultResponseType;
|
||||
protected $responseType;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
@ -87,27 +87,27 @@ class Server implements EmitterAwareInterface
|
||||
$this->clientRepository = $clientRepository;
|
||||
$this->accessTokenRepository = $accessTokenRepository;
|
||||
$this->scopeRepository = $scopeRepository;
|
||||
$this->defaultResponseType = $responseType;
|
||||
$this->privateKeyPath = $privateKeyPath;
|
||||
$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
|
||||
*/
|
||||
public function getDefaultResponseType()
|
||||
public function getResponseType()
|
||||
{
|
||||
if (!$this->defaultResponseType instanceof ResponseTypeInterface) {
|
||||
$this->defaultResponseType = new BearerTokenResponse(
|
||||
$this->defaultPrivateKeyPath,
|
||||
$this->defaultPublicKeyPath,
|
||||
if (!$this->responseType instanceof ResponseTypeInterface) {
|
||||
$this->responseType = new BearerTokenResponse(
|
||||
$this->privateKeyPath,
|
||||
$this->publicKeyPath,
|
||||
$this->accessTokenRepository
|
||||
);
|
||||
}
|
||||
|
||||
return $this->defaultResponseType;
|
||||
return $this->responseType;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -130,7 +130,7 @@ class Server implements EmitterAwareInterface
|
||||
$this->enabledGrantTypes[$grantType->getIdentifier()] = $grantType;
|
||||
|
||||
// Set grant response type
|
||||
$this->grantResponseTypes[$grantType->getIdentifier()] = $this->getDefaultResponseType();
|
||||
$this->grantResponseTypes[$grantType->getIdentifier()] = $this->getResponseType();
|
||||
|
||||
// Set grant access token TTL
|
||||
$this->grantTypeAccessTokenTTL[$grantType->getIdentifier()] = $accessTokenTTL;
|
||||
|
Loading…
Reference in New Issue
Block a user