Skip to content

Commit

Permalink
fix error: if Bearer token is no JWT
Browse files Browse the repository at this point in the history
Signed-off-by: Aaron Lewandowski <[email protected]>
  • Loading branch information
aro-lew committed Nov 24, 2023
1 parent 278bdd4 commit 11dda10
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/User/Backend.php
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,12 @@ public function getCurrentUserId(): string {
return '';
}

$tks = \explode('.', $headerToken);
if (\count($tks) !== 3) {
$this->logger->debug('Bearer token is no JWT');
return '';
}

$oidcSystemConfig = $this->config->getSystemValue('user_oidc', []);
// check if we should use UserInfoValidator (default is false)
if (!isset($oidcSystemConfig['userinfo_bearer_validation']) || !$oidcSystemConfig['userinfo_bearer_validation']) {
Expand Down

0 comments on commit 11dda10

Please sign in to comment.