19declare(strict_types=1);
96 $query_wrapper =
$DIC->http()->wrapper()->query();
97 return $query_wrapper->has(
'ecs_hash') || $query_wrapper->has(
'ecs_hash_url');
103 $query_wrapper =
$DIC->http()->wrapper()->query();
104 $string_refinery =
$DIC->refinery()->kindlyTo()->string();
105 if ($query_wrapper->has(
'ecs_hash') || $query_wrapper->has(
'ecs_hash_url')) {
107 $credentials->setUsername($query_wrapper->retrieve(
'ecs_login', $string_refinery));
108 $credentials->setAuthMode((
string) self::AUTH_ECS);
111 $providers = $provider_factory->getProviders($credentials);
117 $frontend = $frontend_factory->getFrontend(
124 $frontend->authenticate();
126 switch ($status->getStatus()) {
146 if (
null === $a_auth_mode) {
150 if (strpos($a_auth_mode,
'_') !==
false) {
151 $auth_arr = explode(
'_', $a_auth_mode);
152 $auth_switch = $auth_arr[0];
154 $auth_switch = $a_auth_mode;
156 switch ($auth_switch) {
207 switch ((
int) $a_auth_key) {
270 $modes[
'ldap_' . $sid] = (self::AUTH_LDAP .
'_' . $sid);
274 $modes[
'lti_' . $sid] = (self::AUTH_PROVIDER_LTI .
'_' . $sid);
302 $idpId = $idp->getIdpId();
303 $modes[
'saml_' . $idpId] = self::AUTH_SAML .
'_' . $idpId;
307 foreach (self::getAuthPlugins() as $pl) {
308 foreach ($pl->getAuthIds() as $auth_id) {
309 if ($pl->isAuthActive($auth_id)) {
310 $modes[$pl->getAuthName($auth_id)] = $auth_id;
326 self::AUTH_SHIBBOLETH,
331 self::AUTH_PROVIDER_LTI,
332 self::AUTH_OPENID_CONNECT,
336 foreach ($modes as $mode) {
337 if ($mode === self::AUTH_PROVIDER_LTI) {
339 $id = self::AUTH_PROVIDER_LTI .
'_' . $sid;
346 if ($mode === self::AUTH_LDAP) {
348 $id = self::AUTH_LDAP .
'_' . $ldap_id;
354 if ($mode === self::AUTH_SAML) {
356 $id = self::AUTH_SAML .
'_' . $idp->getIdpId();
381 $r =
$ilDB->query(
"SELECT login FROM usr_data WHERE login = " .
382 $ilDB->quote($c_login));
383 if ($r->numRows() > 0) {
385 $c_login = $a_login . $postfix;
409 foreach (self::getAuthPlugins() as $pl) {
410 foreach ($pl->getAuthIds() as $auth_id) {
411 if ($pl->getMultipleAuthModeOptions($auth_id)) {
439 $options[self::AUTH_LDAP .
'_' . $sid][
'txt'] =
$server->getName();
446 $apache_settings =
new ilSetting(
'apache_auth');
451 if (
$ilSetting->get(
'auth_mode', (
string) self::AUTH_LOCAL) === (
string) self::AUTH_LDAP) {
457 $default =
$ilSetting->get(
'default_auth_mode', (
string) $default);
461 foreach ($pls as $pl) {
462 $auths = $pl->getAuthIds();
463 foreach ($auths as $auth_id) {
464 $pl_auth_option = $pl->getMultipleAuthModeOptions($auth_id);
465 if ($pl_auth_option) {
466 $options += $pl_auth_option;
472 if (array_key_exists($default, $options)) {
473 $options[$default][
'checked'] =
true;
515 foreach (self::getAuthPlugins() as $pl) {
516 foreach ($pl->getAuthIds() as $auth_id) {
517 if ($pl->isAuthActive($auth_id) && $pl->isExternalAccountNameRequired($auth_id)) {
533 switch ((
int) $a_auth_mode) {
551 switch ($a_auth_mode) {
563 public static function isPasswordModificationHidden(): bool
570 return $ilSetting->get(
'usr_settings_hide_password') ||
$ilSetting->get(
'usr_settings_disable_password');
584 switch ((
int) $a_authmode) {
600 return $idp->isActive() && $idp->allowLocalAuthentication();
603 return (
bool)
$ilSetting->get(
"shib_auth_allow_local",
'0');
605 return (
bool)
$ilSetting->get(
"soap_auth_allow_local",
'0');
607 return (
bool)
$ilSetting->get(
"cas_allow_local",
'0');
621 if (self::isPasswordModificationHidden()) {
635 switch ((
int) $a_authmode) {
645 if (!self::isPasswordModificationEnabled($a_authmode)) {
664 return $GLOBALS[
'DIC'][
'component.factory']->getActivePluginsInSlot(
'authhk');
674 switch ((
int) $a_auth_key) {
689 $lng->loadLanguageModule(
'auth');
690 if (!empty($auth_name)) {
691 return $lng->txt(
'auth_' . $auth_name);
694 return $lng->txt(
'auth_' . self::_getAuthModeName($a_auth_key));
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Factory for auth frontend classes.
const CONTEXT_STANDARD_FORM
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 STATUS_AUTHENTICATED
static getInstance()
Get status instance.
const STATUS_AUTHENTICATION_FAILED
static utility functions used to manage authentication modes
static _getMultipleAuthModeOptions(ilLanguage $lng)
static _allowPasswordModificationByAuthMode($a_auth_mode)
Allow password modification.
static isAuthenticationForced()
Check if authentication is should be forced.
const AUTH_CAS_NO_ILIAS_USER
const AUTH_SOAP_NO_ILIAS_USER_BUT_EMAIL
static _getActiveAuthModes()
const AUTH_OPENID_CONNECT
static supportsLocalPasswordValidation($a_authmode)
Check if local password validation is supported.
const AUTH_LDAP_NO_ILIAS_USER
static isLocalPasswordEnabledForAuthMode($a_authmode)
Check if local password validation is enabled for a specific auth_mode.
static _isExternalAccountEnabled()
Check if an external account name is required.
static getAuthModeTranslation(string $a_auth_key, string $auth_name='')
const AUTH_USER_SIMULTANEOUS_LOGIN
static getAuthPlugins()
Get active enabled auth plugins.
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
static _needsExternalAccountByAuthMode($a_auth_mode)
Check if chosen auth mode needs an external account entry.
static _getAuthMode(?string $a_auth_mode)
const AUTH_USER_TIME_LIMIT_EXCEEDED
static handleForcedAuthentication()
static _getAllAuthModes()
const AUTH_SOAP_NO_ILIAS_USER
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)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...