7define(
"AUTH_LOCAL", 1);
9define(
"AUTH_RADIUS", 3);
10define(
"AUTH_SCRIPT", 4);
11define(
"AUTH_SHIBBOLETH", 5);
13define(
"AUTH_SOAP", 7);
14define(
"AUTH_HTTP", 8);
17define(
"AUTH_APACHE", 11);
18define(
"AUTH_SAML", 12);
20define(
'AUTH_OPENID_CONNECT', 15);
22define(
"AUTH_INACTIVE", 18);
24define(
'AUTH_MULTIPLE', 20);
26define(
'AUTH_SESSION', 21);
28define(
'AUTH_PROVIDER_LTI', 22);
30define(
'AUTH_SOAP_NO_ILIAS_USER', -100);
31define(
'AUTH_LDAP_NO_ILIAS_USER', -200);
32define(
'AUTH_RADIUS_NO_ILIAS_USER', -300);
37define(
'AUTH_APACHE_FAILED', -500);
38define(
'AUTH_SAML_FAILED', -501);
40define(
'AUTH_MODE_INACTIVE', -1000);
44define(
'AUTH_SOAP_NO_ILIAS_USER_BUT_EMAIL', -101);
45define(
'AUTH_CAS_NO_ILIAS_USER', -90);
48define(
'AUTH_USER_WRONG_IP', -600);
49define(
'AUTH_USER_INACTIVE', -601);
50define(
'AUTH_USER_TIME_LIMIT_EXCEEDED', -602);
51define(
'AUTH_USER_SIMULTANEOUS_LOGIN', -603);
52define(
'AUTH_CAPTCHA_INVALID', -604);
55include_once
'./Services/Authentication/classes/class.ilAuthFactory.php';
56require_once(
'Services/Authentication/classes/class.ilSessionControl.php');
77 if (isset(
$_GET[
'ecs_hash']) or isset(
$_GET[
'ecs_hash_url'])) {
85 if (isset(
$_GET[
'ecs_hash']) or isset(
$_GET[
'ecs_hash_url'])) {
86 include_once
'./Services/Authentication/classes/Frontend/class.ilAuthFrontendCredentials.php';
88 $credentials->setUsername(
$_GET[
'ecs_login']);
91 include_once
'./Services/Authentication/classes/Provider/class.ilAuthProviderFactory.php';
93 $providers = $provider_factory->getProviders($credentials);
95 include_once
'./Services/Authentication/classes/class.ilAuthStatus.php';
98 include_once
'./Services/Authentication/classes/Frontend/class.ilAuthFrontendFactory.php';
101 $frontend = $frontend_factory->getFrontend(
108 $frontend->authenticate();
110 switch ($status->getStatus()) {
130 if ($a_db_handler !=
'') {
131 $db = &$a_db_handler;
135 if (strpos($a_auth_mode,
'_') !==
false) {
136 $auth_arr = explode(
'_', $a_auth_mode);
137 $auth_switch = $auth_arr[0];
139 $auth_switch = $a_auth_mode;
141 switch ($auth_switch) {
148 include_once
'./Services/LDAP/classes/class.ilLDAPServer.php';
153 include_once
'./Services/LTI/classes/InternalProvider/class.ilAuthProviderLTI.php';
173 require_once
'Services/Saml/classes/class.ilSamlIdp.php';
200 $ilias =
$DIC[
'ilias'];
203 switch ((
int) $a_auth_key) {
210 include_once
'./Services/LDAP/classes/class.ilLDAPServer.php';
215 include_once
'./Services/LTI/classes/InternalProvider/class.ilAuthProviderLTI.php';
235 require_once
'Services/Saml/classes/class.ilSamlIdp.php';
262 $ilias =
$DIC[
'ilias'];
269 include_once(
'Services/LDAP/classes/class.ilLDAPServer.php');
271 $modes[
'ldap_' . $sid] = (
AUTH_LDAP .
'_' . $sid);
274 include_once
'./Services/LTI/classes/InternalProvider/class.ilAuthProviderLTI.php';
302 include_once
'./Services/WebServices/ECS/classes/class.ilECSServerSettings.php';
307 require_once
'Services/Saml/classes/class.ilSamlIdp.php';
309 $modes[
'saml_' . $idp->getIdpId()] =
AUTH_SAML .
'_' . $idp->getIdpId();
313 foreach (self::getAuthPlugins() as $pl) {
314 foreach ($pl->getAuthIds() as $auth_id) {
315 if ($pl->isAuthActive($auth_id)) {
316 $modes[$pl->getAuthName($auth_id)] = $auth_id;
340 foreach ($modes as $mode) {
342 include_once
'./Services/LTI/classes/InternalProvider/class.ilAuthProviderLTI.php';
358 require_once
'Services/Saml/classes/class.ilSamlIdp.php';
360 $id =
AUTH_SAML .
'_' . $idp->getIdpId();
385 $r =
$ilDB->query(
"SELECT login FROM usr_data WHERE login = " .
386 $ilDB->quote($c_login));
387 if ($r->numRows() > 0) {
389 $c_login = $a_login . $postfix;
400 include_once(
'Services/Radius/classes/class.ilRadiusSettings.php');
403 if ($rad_settings->isActive()) {
406 include_once(
'Services/LDAP/classes/class.ilLDAPServer.php');
422 foreach ($pl->getAuthIds() as $auth_id) {
423 if ($pl->getMultipleAuthModeOptions($auth_id)) {
441 include_once(
'Services/LDAP/classes/class.ilLDAPServer.php');
453 include_once(
'Services/Radius/classes/class.ilRadiusSettings.php');
455 if ($rad_settings->isActive()) {
456 $options[
AUTH_RADIUS][
'txt'] = $rad_settings->getName();
463 $apache_settings =
new ilSetting(
'apache_auth');
464 $options[
AUTH_APACHE][
'txt'] = $apache_settings->get(
'name',
$lng->txt(
'apache_auth'));
476 $default =
$ilSetting->get(
'default_auth_mode', $default);
477 $default = (int) $_REQUEST[
'auth_mode'] ? (
int) $_REQUEST[
'auth_mode'] : $default;
482 foreach ($pls as $pl) {
483 $auths = $pl->getAuthIds();
484 foreach ($auths as $auth_id) {
485 $pl_auth_option = $pl->getMultipleAuthModeOptions($auth_id);
486 if ($pl_auth_option) {
487 $options = $options + $pl_auth_option;
493 if (array_key_exists($default, $options)) {
494 $options[$default][
'checked'] =
true;
497 return $options ? $options : array();
527 include_once(
'Services/LDAP/classes/class.ilLDAPServer.php');
532 include_once
'./Services/LTI/classes/InternalProvider/class.ilAuthProviderLTI.php';
537 require_once
'Services/Saml/classes/class.ilSamlIdp.php';
547 foreach (self::getAuthPlugins() as $pl) {
548 foreach ($pl->getAuthIds() as $auth_id) {
549 if ($pl->isAuthActive($auth_id) and $pl->isExternalAccountNameRequired($auth_id)) {
569 switch ((
int) $a_auth_mode) {
591 switch ($a_auth_mode) {
603 public static function isPasswordModificationHidden()
610 if (
$ilSetting->get(
'usr_settings_hide_password') ||
$ilSetting->get(
'usr_settings_disable_password')) {
628 switch ((
int) $a_authmode) {
644 require_once
'Services/Saml/classes/class.ilSamlIdp.php';
646 return $idp->isActive() && $idp->allowLocalAuthentication();
649 return $ilSetting->get(
"shib_auth_allow_local");
651 return $ilSetting->get(
"soap_auth_allow_local");
672 if (self::isPasswordModificationHidden()) {
678 switch ((
int) $a_authmode) {
689 require_once
'Services/Saml/classes/class.ilSamlIdp.php';
691 return $idp->isActive() && $idp->allowLocalAuthentication();
700 return $ilSetting->get(
"shib_auth_allow_local");
702 return $ilSetting->get(
"soap_auth_allow_local");
717 switch ((
int) $a_authmode) {
749 $pls =
$GLOBALS[
'DIC'][
'ilPluginAdmin']->getActivePluginsForSlot(
755 foreach ($pls as $pl) {
756 $pl_objs[] =
$GLOBALS[
'DIC'][
'ilPluginAdmin']->getPluginObject(
777 switch ((
int) $a_auth_key) {
779 include_once
'./Services/LDAP/classes/class.ilLDAPServer.php';
785 include_once
'./Services/LTI/classes/InternalProvider/class.ilAuthProviderLTI.php';
791 require_once
'Services/Saml/classes/class.ilSamlIdp.php';
794 return $idp->getEntityId();
797 $lng->loadLanguageModule(
'auth');
798 if (!empty($auth_name)) {
799 return $lng->txt(
'auth_' . $auth_name);
801 return $lng->txt(
'auth_' . self::_getAuthModeName($a_auth_key));
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
An exception for terminatinating execution or to throw for unit testing.
const AUTH_OPENID_CONNECT
Description of class class.
Factory for auth frontend classes.
const CONTEXT_STANDARD_FORM
static getActiveAuthModes()
get all active authmode server ids
static getKeyByAuthMode($a_auth_mode)
Get auth id by auth mode.
static lookupConsumer($a_sid)
Lookup consumer title.
static getServerIdByAuthMode($a_auth_mode)
Get auth id by auth mode.
static getAuthModeByKey($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 getAuthModeTranslation($a_auth_key, $auth_name='')
static _allowPasswordModificationByAuthMode($a_auth_mode)
Allow password modification.
static isAuthenticationForced()
Check if authentication is should be forced.
static _getAuthMode($a_auth_mode, $a_db_handler='')
static _getActiveAuthModes()
static supportsLocalPasswordValidation($a_authmode)
Check if local password validation is supported.
static isLocalPasswordEnabledForAuthMode($a_authmode)
Check if local password validation is enabled for a specific auth_mode.
static _getMultipleAuthModeOptions($lng)
static _isExternalAccountEnabled()
Check if an external account name is required.
static getAuthPlugins()
Get active enabled auth plugins.
static _hasMultipleAuthenticationMethods()
static isPasswordModificationEnabled($a_authmode)
Check if password modification is enabled.
static _generateLogin($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 handleForcedAuthentication()
static _getAllAuthModes()
static _getAuthModeName($a_auth_key)
static getInstance()
Get singleton instance.
static goToPublicSection()
go to public section
static getServerIdByAuthMode($a_auth_mode)
Get auth id by auth mode.
static _getServerList()
Get list of all configured servers.
static getInstanceByServerId($a_server_id)
Get instance by server id.
static _getActiveServerList()
Get active server list.
static getAuthModeByKey($a_auth_key)
get auth mode by key
static getKeyByAuthMode($a_auth_mode)
Get auth id by auth mode.
static getInstance()
Get singleton instance.
static _getInstance()
singleton get instance
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)