php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #72915 HTTP_AUTORIZATION header missing for Bearer Auth when using apache module
Submitted: 2016-08-21 21:02 UTC Modified: 2016-08-26 07:17 UTC
Votes:8
Avg. Score:4.1 ± 0.9
Reproduced:7 of 7 (100.0%)
Same Version:2 (28.6%)
Same OS:2 (28.6%)
From: cpuidle at gmx dot de Assigned:
Status: Open Package: Apache2 related
PHP Version: 7.0.10 OS: OSX
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2016-08-21 21:02 UTC] cpuidle at gmx dot de
Description:
------------
echo $_SERVER['HTTP_AUTHORIZATION']

Test script:
---------------
curl --header "Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE0NzE4MDMwNjYsImV4cCI6MTQ3MTg4OTQ2Niwic3ViIjoidXNlciJ9.1JSvKan_gh5nV6wsLBbmZ0KrO9NKhHX7ktcmzxgtMHM" http://localhost/test.php

Expected result:
----------------
Show authorization header

Actual result:
--------------
$_SERVER['HTTP_AUTHORIZATION'] not present

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-08-26 07:17 UTC] cpuidle at gmx dot de
-Summary: HTTP_AUTORIZATION header missing when php module is used +Summary: HTTP_AUTORIZATION header missing for Bearer Auth when using apache module
 [2016-08-26 07:17 UTC] cpuidle at gmx dot de
To be clear: the $_SERVER['HTTP_AUTHORIZATION'] variable is empty while apache_request_headers() shows that the Authorization header is indeed present. 

It doesn't seem to get picked up by PHP, but why?
 [2016-08-26 07:34 UTC] cpuidle at gmx dot de
Looking at https://github.com/php/php-src/blob/9fc0a5e049ade8082b2b9a45687ac8cbd694f731/main/main.c#L2615 it seems that PHP _only_ supports Basic and Digest authorization and nothing else.
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Thu Oct 22 16:01:24 2020 UTC