From 95d068e818404a3b5dc3bb1afa550bd2eb3a204b Mon Sep 17 00:00:00 2001 From: Luca Degasperi Date: Tue, 6 May 2014 13:52:50 +0200 Subject: [PATCH 1/2] Added a missing use statement --- src/Exception/OAuthException.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Exception/OAuthException.php b/src/Exception/OAuthException.php index b842bffe..dc0dbbfd 100644 --- a/src/Exception/OAuthException.php +++ b/src/Exception/OAuthException.php @@ -11,6 +11,8 @@ namespace League\OAuth2\Server\Exception; +use Symfony\Component\HttpFoundation\Request; + /** * Exception class */ From 07c04d15d7ded93c9799067a9facfa0cd0a72ba0 Mon Sep 17 00:00:00 2001 From: Luca Degasperi Date: Tue, 6 May 2014 14:30:25 +0200 Subject: [PATCH 2/2] updated calls to proper request methods --- src/Exception/OAuthException.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Exception/OAuthException.php b/src/Exception/OAuthException.php index dc0dbbfd..5cbb0b3a 100644 --- a/src/Exception/OAuthException.php +++ b/src/Exception/OAuthException.php @@ -71,10 +71,10 @@ class OAuthException extends \Exception if ($this->errorType === 'invalid_client') { $authScheme = null; $request = new Request(); - if ($request->server('PHP_AUTH_USER') !== null) { + if ($request->getUser() !== null) { $authScheme = 'Basic'; } else { - $authHeader = $request->header('Authorization'); + $authHeader = $request->headers->get('Authorization'); if ($authHeader !== null) { if (strpos($authHeader, 'Bearer') === 0) { $authScheme = 'Bearer';