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:4
Avg. Score:4.5 ± 0.9
Reproduced:3 of 3 (100.0%)
Same Version:2 (66.7%)
Same OS:1 (33.3%)
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
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
28 - 28 = ?
Subscribe to this entry?

 
 [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-2019 The PHP Group
All rights reserved.
Last updated: Fri Aug 23 05:01:27 2019 UTC