mirror of
https://github.com/elyby/oauth2-server.git
synced 2025-02-01 16:29:34 +05:30
Added stateParamRequired method
This commit is contained in:
parent
351580d9d8
commit
5f1609577e
@ -306,6 +306,16 @@ class AuthServer
|
|||||||
return $this->defaultScope;
|
return $this->defaultScope;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Require the "state" paremter in checkAuthoriseParams()
|
||||||
|
* @param boolean $require
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function stateParamRequired()
|
||||||
|
{
|
||||||
|
return $this->requireStateParam;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Require the "state" paremter in checkAuthoriseParams()
|
* Require the "state" paremter in checkAuthoriseParams()
|
||||||
* @param boolean $require
|
* @param boolean $require
|
||||||
|
@ -90,7 +90,7 @@ class AuthCode implements GrantTypeInterface {
|
|||||||
throw new Exception\ClientException(sprintf($this->authServer->getExceptionMessage('invalid_request'), 'redirect_uri'), 0);
|
throw new Exception\ClientException(sprintf($this->authServer->getExceptionMessage('invalid_request'), 'redirect_uri'), 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->authServer->scopeParamRequired() === true && is_null($authParams['state'])) {
|
if ($this->authServer->stateParamRequired() === true && is_null($authParams['state'])) {
|
||||||
throw new Exception\ClientException(sprintf($this->authServer->getExceptionMessage('invalid_request'), 'state'), 0);
|
throw new Exception\ClientException(sprintf($this->authServer->getExceptionMessage('invalid_request'), 'state'), 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user