19 declare(strict_types=1);
40 $this->
logger = $DIC->logger()->auth();
42 $this->
lng = $DIC->language();
43 $this->
lng->loadLanguageModule(
'auth');
53 $this->
logger->debug(
'Logging out with token: ' . $id_token);
55 if (isset($id_token) && $id_token !==
'') {
63 }
catch (\Jumbojett\OpenIDConnectClientException
$e) {
64 $this->
logger->warning(
"Logging out of OIDC provider failed with: " . $e->getMessage());
74 $oidc->setRedirectURL(ILIAS_HTTP_PATH .
'/openidconnect.php');
77 if ($proxy->isActive()) {
78 $host = $proxy->getHost();
79 $port = $proxy->getPort();
83 $oidc->setHttpProxy($host);
88 $oidc->getRedirectURL()
91 $oidc->addScope($this->
settings->getAllScopes());
93 $oidc->addAuthParam([
'prompt' =>
'login']);
96 $oidc->authenticate();
99 $claims = $oidc->getVerifiedClaims();
111 $this->
logger->warning($e->getMessage());
112 $this->
logger->warning((
string) $e->getCode());
127 if (!is_object($user_info)) {
128 $this->
logger->error(
'Received invalid user credentials: ');
135 $uid_field = $this->
settings->getUidField();
136 $ext_account = $user_info->{$uid_field} ??
'';
138 if (!is_string($ext_account) || $ext_account ===
'') {
139 $this->
logger->error(
'Could not determine valid external account, value is empty or not a string.');
142 $status->setReason(
'err_wrong_login');
146 $this->
logger->debug(
'Authenticated external account: ' . $ext_account);
155 $sync->setExternalAccount($ext_account);
156 $sync->setInternalAccount((
string) $int_account);
167 $status->setReason(
'err_wrong_login');
175 $oidc =
new OpenIDConnectClient(
const AUTH_OPENID_CONNECT
static get(string $a_var)
doAuthentication(ilAuthStatus $status)
const LOGOUT_SCOPE_GLOBAL
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
const STATUS_AUTHENTICATION_FAILED
static _checkExternalAuthAccount(string $a_auth, string $a_account, bool $tryFallback=true)
check whether external account and authentication method matches with a user
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilOpenIdConnectSettings $settings
static logoutUrl(array $parameters=[])
Return the logout URL with a valid CSRF token.
Class ilAuthProviderOpenIdConnect.
setStatus(int $a_status)
Set auth status.
ilAuthCredentials $credentials
const STATUS_AUTHENTICATED
handleUpdate(ilAuthStatus $status, $user_info)
setTranslatedReason(string $a_reason)
Set translated reason.
setReason(string $a_reason)
Set reason.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(ilAuthCredentials $credentials)
static set(string $a_var, $a_val)
Set a value.