19declare(strict_types=1);
78 $query_wrapper =
$DIC->http()->wrapper()->query();
79 return $query_wrapper->has(
'ecs_hash') || $query_wrapper->has(
'ecs_hash_url');
85 $query_wrapper =
$DIC->http()->wrapper()->query();
86 $string_refinery =
$DIC->refinery()->kindlyTo()->string();
87 if ($query_wrapper->has(
'ecs_hash') || $query_wrapper->has(
'ecs_hash_url')) {
89 $credentials->setUsername($query_wrapper->retrieve(
'ecs_login', $string_refinery));
90 $credentials->setAuthMode((
string) self::AUTH_ECS);
93 $providers = $provider_factory->getProviders($credentials);
99 $frontend = $frontend_factory->getFrontend(
105 $frontend->authenticate();
107 switch ($status->getStatus()) {
127 if ($a_auth_mode ===
null) {
131 if (str_contains($a_auth_mode,
'_')) {
132 $auth_arr = explode(
'_', $a_auth_mode);
133 $auth_switch = $auth_arr[0];
135 $auth_switch = $a_auth_mode;
137 switch ($auth_switch) {
184 switch ((
int) $a_auth_key) {
243 $modes[
'ldap_' . $sid] = (self::AUTH_LDAP .
'_' . $sid);
247 $modes[
'lti_' . $sid] = (self::AUTH_PROVIDER_LTI .
'_' . $sid);
272 $idpId = $idp->getIdpId();
273 $modes[
'saml_' . $idpId] = self::AUTH_SAML .
'_' . $idpId;
277 foreach (self::getAuthPlugins() as $pl) {
278 foreach ($pl->getAuthIds() as $auth_id) {
279 if ($pl->isAuthActive($auth_id)) {
280 $modes[$pl->getAuthName($auth_id)] = $auth_id;
305 foreach ($modes as $mode) {
306 if ($mode === self::AUTH_PROVIDER_LTI) {
308 $id = self::AUTH_PROVIDER_LTI .
'_' . $sid;
315 if ($mode === self::AUTH_LDAP) {
317 $id = self::AUTH_LDAP .
'_' . $ldap_id;
323 if ($mode === self::AUTH_SAML) {
325 $id = self::AUTH_SAML .
'_' . $idp->getIdpId();
351 'SELECT login FROM usr_data WHERE login = ' .
352 $ilDB->quote($c_login)
354 if ($r->numRows() > 0) {
356 $c_login = $a_login . $postfix;
380 foreach (self::getAuthPlugins() as $pl) {
381 foreach ($pl->getAuthIds() as $auth_id) {
382 if ($pl->getMultipleAuthModeOptions($auth_id)) {
408 $options[self::AUTH_LDAP .
'_' . $sid][
'txt'] =
$server->getName();
415 $apache_settings =
new ilSetting(
'apache_auth');
420 if (
$ilSetting->get(
'auth_mode', (
string) self::AUTH_LOCAL) === (
string) self::AUTH_LDAP) {
426 $default =
$ilSetting->get(
'default_auth_mode', (
string) $default);
430 foreach ($pls as $pl) {
431 $auths = $pl->getAuthIds();
432 foreach ($auths as $auth_id) {
433 $pl_auth_option = $pl->getMultipleAuthModeOptions($auth_id);
434 if ($pl_auth_option) {
435 $options += $pl_auth_option;
441 if (array_key_exists($default, $options)) {
442 $options[$default][
'checked'] =
true;
481 foreach (self::getAuthPlugins() as $pl) {
482 foreach ($pl->getAuthIds() as $auth_id) {
483 if ($pl->isAuthActive($auth_id) && $pl->isExternalAccountNameRequired($auth_id)) {
499 switch ((
int) $a_auth_mode) {
517 switch ($a_auth_mode) {
526 public static function isPasswordModificationHidden(): bool
531 $password_setting =
$DIC[
'user']->getSettings()->getSettingByDefinitionClass(Password::class);
533 return !$password_setting->isChangeableByUser();
546 switch ((
int) $a_authmode) {
562 return $idp->isActive() && $idp->allowLocalAuthentication();
565 return (
bool)
$ilSetting->get(
'shib_auth_allow_local',
'0');
567 return (
bool)
$ilSetting->get(
'soap_auth_allow_local',
'0');
579 if (self::isPasswordModificationHidden()) {
593 switch ((
int) $a_authmode) {
602 if (!self::isPasswordModificationEnabled($a_authmode)) {
620 return $GLOBALS[
'DIC'][
'component.factory']->getActivePluginsInSlot(
'authhk');
630 switch ((
int) $a_auth_key) {
645 $lng->loadLanguageModule(
'auth');
646 if (!empty($auth_name)) {
647 return $lng->txt(
'auth_' . $auth_name);
650 return $lng->txt(
'auth_' . self::_getAuthModeName($a_auth_key));
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
const int CONTEXT_STANDARD_FORM
Authentication with id and password.
static getServerIdByAuthMode(string $a_auth_mode)
Get auth id by auth mode.
static getActiveAuthModes()
get all active authmode server ids
static getKeyByAuthMode(string $a_auth_mode)
Get auth id by auth mode.
static lookupConsumer(int $a_sid)
Lookup consumer title.
static getAuthModeByKey(string $a_auth_key)
Get auth mode by key.
const int STATUS_AUTHENTICATION_FAILED
const int STATUS_AUTHENTICATED
static getInstance()
Get status instance.
static _getMultipleAuthModeOptions(ilLanguage $lng)
static _allowPasswordModificationByAuthMode($a_auth_mode)
Allow password modification.
const int AUTH_SHIBBOLETH
const int AUTH_APACHE_FAILED
const int AUTH_LDAP_NO_ILIAS_USER
static isAuthenticationForced()
static _getActiveAuthModes()
const array REGEX_DELIMITERS
const int AUTH_SOAP_NO_ILIAS_USER
static supportsLocalPasswordValidation($a_authmode)
Check if local password validation is supported.
const int AUTH_USER_INACTIVE
static isLocalPasswordEnabledForAuthMode($a_authmode)
Check if local password validation is enabled for a specific auth_mode.
const int AUTH_USER_SIMULTANEOUS_LOGIN
static _isExternalAccountEnabled()
Check if an external account name is required.
static getAuthModeTranslation(string $a_auth_key, string $auth_name='')
const int AUTH_SOAP_NO_ILIAS_USER_BUT_EMAIL
const int AUTH_OPENID_CONNECT
static _hasMultipleAuthenticationMethods()
static isPasswordModificationEnabled($a_authmode)
Check if password modification is enabled.
static _generateLogin(string $a_login)
generate free login by starting with a default string and adding postfix numbers
const int AUTH_PROVIDER_LTI
static _needsExternalAccountByAuthMode($a_auth_mode)
Check if chosen auth mode needs an external account entry.
const int AUTH_USER_TIME_LIMIT_EXCEEDED
static _getAuthMode(?string $a_auth_mode)
static handleForcedAuthentication()
const int AUTH_SAML_FAILED
const int AUTH_USER_WRONG_IP
static _getAllAuthModes()
const int AUTH_MODE_INACTIVE
static _getAuthModeName($a_auth_key)
static getInstance()
Get singleton instance.
static goToPublicSection()
go to public section
static _getServerList()
Get list of all configured servers.
static getAuthModeByKey(string $a_auth_key)
get auth mode by key
static _getActiveServerList()
Get active server list.
static getInstanceByServerId(int $a_server_id)
Get instance by server id.
static getServerIdByAuthMode(string $a_auth_mode)
Get auth id by auth mode.
static getKeyByAuthMode(string $a_auth_mode)
Get auth id by auth mode.
static getActiveIdpList()
static getIdpIdByAuthMode(string $a_auth_mode)
static getAuthModeByKey(string $a_auth_key)
static getInstanceByIdpId(int $a_idp_id)
static getKeyByAuthMode(string $a_auth_mode)