Skip to content

Commit

Permalink
Merge pull request #10 from cvette/fix/cv-multiple-headers
Browse files Browse the repository at this point in the history
BUGFIX: Multiple authorization headers
  • Loading branch information
kitsunet authored Jul 26, 2022
2 parents 6b41fe0 + 2db2242 commit 2f498a0
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions Classes/Security/SessionStartingHashToken.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,14 @@ public function updateCredentials(ActionRequest $actionRequest)
$authenticationHashToken = $actionRequest->getHttpRequest()->getQueryParams()['_authenticationHashToken'] ?? null;

if (!$authenticationHashToken) {
$authorizationHeader = $actionRequest->getHttpRequest()->getHeader('Authorization');
if ($authorizationHeader) {
$authenticationHashToken = str_replace('Bearer ', '', $authorizationHeader);
$authorizationHeaders = $actionRequest->getHttpRequest()->getHeader('Authorization');
if (!empty($authorizationHeaders)) {
foreach ($authorizationHeaders as $authorizationHeader) {
if (strpos($authorizationHeader, 'Bearer ') === 0) {
$authenticationHashToken = str_replace('Bearer ', '', $authorizationHeader);
break;
}
}
}
}

Expand Down

0 comments on commit 2f498a0

Please sign in to comment.