mirror of
https://github.com/elyby/oauth2-server.git
synced 2025-03-12 19:29:18 +05:30
Expose parameter passed to exceptions
This commit is contained in:
parent
c84ea1ea62
commit
b256195421
@ -32,7 +32,7 @@ class InvalidGrantException extends OAuthException
|
|||||||
|
|
||||||
public function __construct($parameter)
|
public function __construct($parameter)
|
||||||
{
|
{
|
||||||
$this->parameter = parameter;
|
$this->parameter = $parameter;
|
||||||
parent::__construct(
|
parent::__construct(
|
||||||
sprintf(
|
sprintf(
|
||||||
'The provided authorization grant is invalid, expired, revoked, does not match the redirection URI used in the authorization request, or was issued to another client. Check the "%s" parameter.',
|
'The provided authorization grant is invalid, expired, revoked, does not match the redirection URI used in the authorization request, or was issued to another client. Check the "%s" parameter.',
|
||||||
|
@ -32,7 +32,7 @@ class InvalidRequestException extends OAuthException
|
|||||||
|
|
||||||
public function __construct($parameter, $redirectUri = null)
|
public function __construct($parameter, $redirectUri = null)
|
||||||
{
|
{
|
||||||
$this->parameter = parameter;
|
$this->parameter = $parameter;
|
||||||
parent::__construct(
|
parent::__construct(
|
||||||
sprintf(
|
sprintf(
|
||||||
'The request is missing a required parameter, includes an invalid parameter value, includes a parameter more than once, or is otherwise malformed. Check the "%s" parameter.',
|
'The request is missing a required parameter, includes an invalid parameter value, includes a parameter more than once, or is otherwise malformed. Check the "%s" parameter.',
|
||||||
|
@ -32,7 +32,7 @@ class InvalidScopeException extends OAuthException
|
|||||||
|
|
||||||
public function __construct($parameter, $redirectUri = null)
|
public function __construct($parameter, $redirectUri = null)
|
||||||
{
|
{
|
||||||
$this->parameter = parameter;
|
$this->parameter = $parameter;
|
||||||
parent::__construct(
|
parent::__construct(
|
||||||
sprintf(
|
sprintf(
|
||||||
'The requested scope is invalid, unknown, or malformed. Check the "%s" scope.',
|
'The requested scope is invalid, unknown, or malformed. Check the "%s" scope.',
|
||||||
|
@ -84,7 +84,7 @@ class OAuthException extends \Exception
|
|||||||
*/
|
*/
|
||||||
public function getParameter()
|
public function getParameter()
|
||||||
{
|
{
|
||||||
return $this->redirectUri;
|
return $this->parameter;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -31,7 +31,7 @@ class ServerErrorException extends OAuthException
|
|||||||
*/
|
*/
|
||||||
public function __construct($parameter = null)
|
public function __construct($parameter = null)
|
||||||
{
|
{
|
||||||
$this->parameter = parameter;
|
$this->parameter = $parameter;
|
||||||
$parameter = is_null($parameter) ? 'The authorization server encountered an unexpected condition which prevented it from fulfilling the request.' : $parameter;
|
$parameter = is_null($parameter) ? 'The authorization server encountered an unexpected condition which prevented it from fulfilling the request.' : $parameter;
|
||||||
parent::__construct($parameter);
|
parent::__construct($parameter);
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ class UnsupportedGrantTypeException extends OAuthException
|
|||||||
|
|
||||||
public function __construct($parameter)
|
public function __construct($parameter)
|
||||||
{
|
{
|
||||||
$this->parameter = parameter;
|
$this->parameter = $parameter;
|
||||||
parent::__construct(
|
parent::__construct(
|
||||||
sprintf(
|
sprintf(
|
||||||
'The authorization grant type "%s" is not supported by the authorization server.',
|
'The authorization grant type "%s" is not supported by the authorization server.',
|
||||||
|
@ -31,7 +31,7 @@ class UnsupportedResponseTypeException extends OAuthException
|
|||||||
*/
|
*/
|
||||||
public function __construct($parameter, $redirectUri = null)
|
public function __construct($parameter, $redirectUri = null)
|
||||||
{
|
{
|
||||||
$this->parameter = parameter;
|
$this->parameter = $parameter;
|
||||||
parent::__construct('The authorization server does not support obtaining an access token using this method.');
|
parent::__construct('The authorization server does not support obtaining an access token using this method.');
|
||||||
$this->redirectUri = $redirectUri;
|
$this->redirectUri = $redirectUri;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user