Skip to content

Commit 5cfe9b1

Browse files
authored
Merge pull request #1386 from nextcloud/enh/1366/only-check-bearer
Do not try to validate all Authorization header values
2 parents ab67334 + 2aa104a commit 5cfe9b1

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

lib/User/Backend.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,10 @@ public function getCurrentUserId(): string {
235235

236236
// get the bearer token from headers
237237
$headerToken = $this->request->getHeader(Application::OIDC_API_REQ_HEADER);
238+
if (!str_starts_with($headerToken, 'bearer ') && !str_starts_with($headerToken, 'Bearer ')) {
239+
$this->logger->debug('No Bearer token');
240+
return '';
241+
}
238242
$headerToken = preg_replace('/^bearer\s+/i', '', $headerToken);
239243
if ($headerToken === '') {
240244
$this->logger->debug('No Bearer token');

0 commit comments

Comments
 (0)