mirror of
https://github.com/elyby/oauth2-server.git
synced 2025-05-31 14:12:07 +05:30
Removed default wording as there is no override
This commit is contained in:
@@ -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');
|
||||||
|
@@ -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;
|
||||||
|
Reference in New Issue
Block a user