Compare commits

..

4 Commits
3.2.1 ... 3.2.2

Author SHA1 Message Date
Phil Sturgeon
9658aa80ba Rejiggery. 2014-07-15 15:50:11 +01:00
Phil Sturgeon
08b1640ea3 Merge branch 'develop' of github.com:thephpleague/oauth2-server 2014-07-15 15:48:42 +01:00
Phil Sturgeon
7771bc04ec Merge pull request #186 from ushahidi/resource-server-correct-http-error
Send HTTP 401 for invalid_token, rather than insufficient_scope
2014-07-15 15:39:28 +01:00
Woody Gilk
f34dd4a0cb 401 status is for invalid_token, not insufficient_scope 2014-07-11 11:59:18 -05:00
5 changed files with 5 additions and 5 deletions

View File

@@ -5,7 +5,7 @@ php:
- 5.5
- 5.6
- hhvm
matrix:
allow_failures:
- php: hhvm

View File

@@ -12,7 +12,7 @@ The framework is provided as a Composer package which can be installed by adding
```javascript
{
"require": {
"league/oauth2-server": "3.*"
"league/oauth2-server": "~3.2"
}
}
```

View File

@@ -163,7 +163,7 @@ class Resource
// include the "WWW-Authenticate" response header field
// matching the authentication scheme used by the client.
// @codeCoverageIgnoreStart
if ($error === 'insufficient_scope') {
if ($error === 'invalid_token') {
$authScheme = null;
$request = new Request();
if ($request->server('PHP_AUTH_USER') !== null) {

View File

@@ -38,8 +38,8 @@ class Resource_Server_test extends PHPUnit_Framework_TestCase
public function test_getExceptionHttpHeaders()
{
$this->assertEquals(array('HTTP/1.1 400 Bad Request'), League\OAuth2\Server\Resource::getExceptionHttpHeaders('invalid_request'));
$this->assertEquals(array('HTTP/1.1 401 Unauthorized'), League\OAuth2\Server\Resource::getExceptionHttpHeaders('invalid_token'));
$this->assertContains('HTTP/1.1 403 Forbidden', League\OAuth2\Server\Resource::getExceptionHttpHeaders('insufficient_scope'));
$this->assertContains('HTTP/1.1 401 Unauthorized', League\OAuth2\Server\Resource::getExceptionHttpHeaders('invalid_token'));
$this->assertEquals(array('HTTP/1.1 403 Forbidden'), League\OAuth2\Server\Resource::getExceptionHttpHeaders('insufficient_scope'));
}
public function test_setRequest()