getScopes() now have the grant type and client ID passed

This commit is contained in:
Alex Bilbie 2013-03-28 10:44:45 +00:00
parent a7b4f7d66b
commit a18b4184f5
3 changed files with 5 additions and 4 deletions

View File

@ -115,7 +115,7 @@ class ClientCredentials implements GrantTypeInterface {
$authParams['scopes'] = array();
foreach ($scopes as $scope) {
$scopeDetails = $this->authServer->getStorage('scope')->getScope($scope);
$scopeDetails = $this->authServer->getStorage('scope')->getScope($scope, $authParams['client_id'], $this->identifier);
if ($scopeDetails === false) {
throw new Exception\ClientException(sprintf($this->authServer->getExceptionMessage('invalid_scope'), $scope), 4);

View File

@ -158,7 +158,7 @@ class Password implements GrantTypeInterface {
$authParams['scopes'] = array();
foreach ($scopes as $scope) {
$scopeDetails = $this->authServer->getStorage('scope')->getScope($scope);
$scopeDetails = $this->authServer->getStorage('scope')->getScope($scope, $authParams['client_id'], $this->identifier);
if ($scopeDetails === false) {
throw new Exception\ClientException(sprintf($this->authServer->getExceptionMessage('invalid_scope'), $scope), 4);

View File

@ -35,7 +35,8 @@ interface ScopeInterface
* </code>
*
* @param string $scope The scope
* @param string $clientId The client ID
* @return bool|array If the scope doesn't exist return false
*/
public function getScope($scope);
public function getScope($scope, $clientId = null, $grantType = null);
}