Skip to content

Commit 8bd6785

Browse files
authored
Fixing API authentication issue with Apache with PHP as cgi/fastCGI (#42593)
1 parent 2964ee6 commit 8bd6785

File tree

1 file changed

+5
-0
lines changed
  • plugins/api-authentication/token/src/Extension

1 file changed

+5
-0
lines changed

plugins/api-authentication/token/src/Extension/Token.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,11 @@ public function onUserAuthenticate($credentials, $options, &$response): void
113113
}
114114
}
115115

116+
// Another Apache specific fix. See https://github.com/symfony/symfony/issues/1813
117+
if (empty($authHeader)) {
118+
$authHeader = $this->getApplication()->getInput()->server->get('REDIRECT_HTTP_AUTHORIZATION', '', 'string');
119+
}
120+
116121
if (substr($authHeader, 0, 7) == 'Bearer ') {
117122
$parts = explode(' ', $authHeader, 2);
118123
$tokenString = trim($parts[1]);

0 commit comments

Comments
 (0)