Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow lowercase auth header #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ private function attempt_jwt_login() {
$headers = apache_request_headers();
if (isset($headers['Authorization'])) {
$authHeader = $headers['Authorization'];
} else if (isset($headers['authorization'])) {
$authHeader = $headers['authorization'];
}
}

Expand All @@ -96,21 +98,24 @@ private function attempt_jwt_login() {
if (isset($_SERVER['Authorization'])) {
$authHeader = $_SERVER['Authorization'];
}
else if (isset($_SERVER['authorization'])) {
$authHeader = $_SERVER['authorization'];
}
else if (isset($_SERVER['HTTP_AUTHORIZATION'])) {
$authHeader = $_SERVER['HTTP_AUTHORIZATION'];
}
}
}

if (!isset($authHeader))
return;

$payload = $this->parse_jwt_component($authHeader);
if (is_null($payload))
return;

/**
* We allow the environment to specify whether to perform an issuer check.
*
*
* For some environments, this will be necessary, but for ADL's P1 deployment
* this doesn't add any extra security.
*/
Expand Down