Skip to content

Commit

Permalink
fix: userinfo oauth endpoint should be called if decodeJWT function w…
Browse files Browse the repository at this point in the history
…as failed
  • Loading branch information
aamsur committed Oct 14, 2024
1 parent 853b832 commit 2e44a7d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions app/Domain/Oidc/Services/Oidc.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,14 @@ public function callback(string $code, string $state): Response
//echo '<pre>' . print_r($tokens, true) . '</pre>';
if (isset($tokens['id_token'])) {
$userInfo = $this->decodeJWT($tokens['id_token']);
} elseif (isset($tokens['access_token'])) {
}

if ($userInfo == null && isset($tokens['access_token'])) {
//falback to OAuth userinfo endpoint
$userInfo = $this->pollUserInfo($tokens['access_token']);
} else {
}

if ((!isset($tokens['access_token'])) && (!isset($tokens['access_token']))) {
$this->displayError('oidc.error.unsupportedToken');
}

Expand Down

0 comments on commit 2e44a7d

Please sign in to comment.