Skip to content
Merged
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
5 changes: 4 additions & 1 deletion lib/User/Backend.php
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,11 @@ public function getCurrentUserId(): string {
}

// get the bearer token from headers
// the auth-scheme is case-insensitive and is separated from the credentials
// by one or more spaces or horizontal tabs (RFC 9110, section 11.1), so this
// guard has to accept exactly what the strip below removes
$headerToken = $this->request->getHeader(Application::OIDC_API_REQ_HEADER);
if (!str_starts_with($headerToken, 'bearer ') && !str_starts_with($headerToken, 'Bearer ')) {
if (preg_match('/^bearer\s+/i', $headerToken) !== 1) {
$this->logger->debug('No Bearer token');
return '';
}
Expand Down
Loading