From 15b372c9ce79ceb2d3c69247622f8c099f4adf7c Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Sun, 20 Sep 2015 19:46:07 +0200 Subject: [PATCH 1/1] Fix #20 and #25: Add authorization header workaround for fcgid Apparently the "Authorization" header are passed into PHP as HTTP_XAUTHORIZATION instead of HTTP_AUTHORIZATION. --- lib/oauth.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/oauth.php b/lib/oauth.php index 4a652fc..4bc46dd 100644 --- a/lib/oauth.php +++ b/lib/oauth.php @@ -161,6 +161,11 @@ class OAuth $params = array(); //$_SERVER['REDIRECT_HTTP_AUTHORIZATION'] = $_SERVER['HTTP_AUTHORIZATION']; + //copy http auth headers for apache+php-fcgid work around + if (isset($_SERVER['HTTP_XAUTHORIZATION']) && !isset($_SERVER['HTTP_AUTHORIZATION'])) { + $_SERVER['HTTP_AUTHORIZATION'] = $_SERVER['HTTP_XAUTHORIZATION']; + } + if (isset($_SERVER['HTTP_AUTHORIZATION']) && $_SERVER['HTTP_AUTHORIZATION'] == '' ) { -- 2.30.2