Skip to content

Commit

Permalink
Merge pull request #2739 from aamsur/fix-oidc-bugs
Browse files Browse the repository at this point in the history
Fix OIDC bugs
  • Loading branch information
marcelfolaron authored Oct 14, 2024
2 parents f2cc335 + 01ddf79 commit bd5140c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/Domain/Oidc/Controllers/Callback.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function get($params): Response
} catch (\Exception $e) {
$this->tpl->setNotification($e->getMessage(), 'danger', 'oidc_error');

return Frontcontroller::redirect(BASE_URL.'/oidc/login');
return Frontcontroller::redirect(BASE_URL.'/auth/login');
}
}
}
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 bd5140c

Please sign in to comment.