Set the scope parameter to not be required by default. Fixes #43

This commit is contained in:
Alex Bilbie
2013-05-09 10:02:41 -07:00
parent c3b41a5e8a
commit ddefb2ee16
3 changed files with 5 additions and 4 deletions

View File

@@ -152,7 +152,7 @@ class AuthCode implements GrantTypeInterface {
if ($scopes[$i] === '') unset($scopes[$i]); // Remove any junk scopes
}
if ($this->authServer->scopeParamRequired() === true && count($scopes) === 0) {
if ($this->authServer->scopeParamRequired() === true && $this->authServer->getDefaultScope() === null && count($scopes) === 0) {
throw new Exception\ClientException(sprintf($this->authServer->getExceptionMessage('invalid_request'), 'scope'), 0);
} elseif (count($scopes) === 0 && $this->authServer->getDefaultScope()) {
$scopes = array($this->authServer->getDefaultScope());