mirror of
https://github.com/elyby/oauth2-server.git
synced 2024-12-17 02:29:46 +05:30
Merge branch 'refs/heads/v4.0.0-WIP' into 4.0.0-156-token-types
This commit is contained in:
commit
0d293e7c30
@ -11,6 +11,8 @@
|
|||||||
|
|
||||||
namespace League\OAuth2\Server\Exception;
|
namespace League\OAuth2\Server\Exception;
|
||||||
|
|
||||||
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Exception class
|
* Exception class
|
||||||
*/
|
*/
|
||||||
@ -69,10 +71,10 @@ class OAuthException extends \Exception
|
|||||||
if ($this->errorType === 'invalid_client') {
|
if ($this->errorType === 'invalid_client') {
|
||||||
$authScheme = null;
|
$authScheme = null;
|
||||||
$request = new Request();
|
$request = new Request();
|
||||||
if ($request->server('PHP_AUTH_USER') !== null) {
|
if ($request->getUser() !== null) {
|
||||||
$authScheme = 'Basic';
|
$authScheme = 'Basic';
|
||||||
} else {
|
} else {
|
||||||
$authHeader = $request->header('Authorization');
|
$authHeader = $request->headers->get('Authorization');
|
||||||
if ($authHeader !== null) {
|
if ($authHeader !== null) {
|
||||||
if (strpos($authHeader, 'Bearer') === 0) {
|
if (strpos($authHeader, 'Bearer') === 0) {
|
||||||
$authScheme = 'Bearer';
|
$authScheme = 'Bearer';
|
||||||
|
Loading…
Reference in New Issue
Block a user