Skip to content

Commit

Permalink
Fixing API authentication issue with Apache with PHP as cgi/fastCGI (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
Hackwar authored May 17, 2024
1 parent 2964ee6 commit 8bd6785
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions plugins/api-authentication/token/src/Extension/Token.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,11 @@ public function onUserAuthenticate($credentials, $options, &$response): void
}
}

// Another Apache specific fix. See https://github.com/symfony/symfony/issues/1813
if (empty($authHeader)) {
$authHeader = $this->getApplication()->getInput()->server->get('REDIRECT_HTTP_AUTHORIZATION', '', 'string');
}

if (substr($authHeader, 0, 7) == 'Bearer ') {
$parts = explode(' ', $authHeader, 2);
$tokenString = trim($parts[1]);
Expand Down

0 comments on commit 8bd6785

Please sign in to comment.