41 $this->
getLogger()->debug(
'Using token: ' . $auth_token);
43 if (strlen($auth_token)) {
48 ILIAS_HTTP_PATH .
'/logout.php'
62 $oidc->setRedirectURL(ILIAS_HTTP_PATH .
'/openidconnect.php');
66 $oidc->getRedirectURL()
69 $oidc->setResponseTypes(
84 $oidc->addAuthParam([
'response_mode' =>
'form_post']);
85 switch ($this->
settings->getLoginPromptType()) {
87 $oidc->addAuthParam([
'prompt' =>
'login']);
90 $oidc->setAllowImplicitFlow(
true);
92 $oidc->authenticate();
96 $claims =
$oidc->getVerifiedClaims(
null);
108 }
catch (Exception $e) {
109 $this->
getLogger()->warning($e->getMessage());
110 $this->
getLogger()->warning($e->getCode());
112 $status->setTranslatedReason($e->getMessage());
124 if (!is_object($user_info)) {
125 $this->
getLogger()->error(
'Received invalid user credentials: ');
128 $status->setReason(
'err_wrong_login');
132 $uid_field = $this->
settings->getUidField();
133 $ext_account = $user_info->$uid_field;
135 $this->
getLogger()->debug(
'Authenticated external account: ' . $ext_account);
145 if (!is_string($ext_account)) {
147 $status->setReason(
'err_wrong_login');
150 $sync->setExternalAccount($ext_account);
151 $sync->setInternalAccount($int_account);
163 $status->setReason(
'err_wrong_login');
176 $this->settings->getClientId(),
177 $this->settings->getSecret()
An exception for terminatinating execution or to throw for unit testing.
Require the CURL and JSON PHP extensions to be installed.
Class ilAuthProviderOpenIdConnect.
handleUpdate(ilAuthStatus $status, $user_info)
handleLogout()
Handle logout event.
__construct(ilAuthCredentials $credentials)
ilAuthProviderOpenIdConnect constructor.
doAuthentication(\ilAuthStatus $status)
Do authentication.
Base class for authentication providers (radius, ldap, apache, ...)
Auth status implementation.
const STATUS_AUTHENTICATED
const STATUS_AUTHENTICATION_FAILED
static _checkExternalAuthAccount($a_auth, $a_account, $tryFallback=true)
check whether external account and authentication method matches with a user
static getInstance()
Get singleton instance.
const LOGOUT_SCOPE_GLOBAL
Class ilOpenIdConnectSettingsGUI.
Class ilOpenIdConnectSettingsGUI.
static set($a_var, $a_val)
Set a value.
static get($a_var)
Get a value.
Interface of auth credentials.
Standard interface for auth provider implementations.