From: Christian Weiske Date: Sun, 20 Sep 2015 17:46:07 +0000 (+0200) Subject: Fix #20 and #25: Add authorization header workaround for fcgid X-Git-Tag: v0.6.1~1 X-Git-Url: https://git.cweiske.de/grauphel.git/commitdiff_plain/15b372c9ce79ceb2d3c69247622f8c099f4adf7c?ds=sidebyside 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. --- 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'] == '' ) {