7 define(
"AUTH_LOCAL", 1);
8 define(
"AUTH_LDAP", 2);
9 define(
"AUTH_RADIUS", 3);
10 define(
"AUTH_SCRIPT", 4);
11 define(
"AUTH_SHIBBOLETH", 5);
12 define(
"AUTH_CAS", 6);
13 define(
"AUTH_SOAP", 7);
15 define(
"AUTH_HTTP", 8);
17 define(
"AUTH_ECS", 9);
19 define(
"AUTH_APACHE", 11);
20 define(
"AUTH_SAML", 12);
22 define(
'AUTH_OPENID_CONNECT', 15);
24 define(
"AUTH_INACTIVE", 18);
26 define(
'AUTH_MULTIPLE', 20);
28 define(
'AUTH_SESSION', 21);
30 define(
'AUTH_PROVIDER_LTI', 22);
32 define(
'AUTH_SOAP_NO_ILIAS_USER', -100);
33 define(
'AUTH_LDAP_NO_ILIAS_USER', -200);
34 define(
'AUTH_RADIUS_NO_ILIAS_USER', -300);
39 define(
'AUTH_APACHE_FAILED', -500);
40 define(
'AUTH_SAML_FAILED', -501);
42 define(
'AUTH_MODE_INACTIVE', -1000);
46 define(
'AUTH_SOAP_NO_ILIAS_USER_BUT_EMAIL', -101);
47 define(
'AUTH_CAS_NO_ILIAS_USER', -90);
50 define(
'AUTH_USER_WRONG_IP', -600);
51 define(
'AUTH_USER_INACTIVE', -601);
52 define(
'AUTH_USER_TIME_LIMIT_EXCEEDED', -602);
53 define(
'AUTH_USER_SIMULTANEOUS_LOGIN', -603);
54 define(
'AUTH_CAPTCHA_INVALID', -604);
57 include_once
'./Services/Authentication/classes/class.ilAuthFactory.php';
58 require_once(
'Services/Authentication/classes/class.ilSessionControl.php');
87 if (isset(
$_GET[
'ecs_hash'])
or isset(
$_GET[
'ecs_hash_url'])) {
95 if (isset(
$_GET[
'ecs_hash'])
or isset(
$_GET[
'ecs_hash_url'])) {
96 include_once
'./Services/Authentication/classes/Frontend/class.ilAuthFrontendCredentials.php';
98 $credentials->setUsername(
$_GET[
'ecs_login']);
101 include_once
'./Services/Authentication/classes/Provider/class.ilAuthProviderFactory.php';
103 $providers = $provider_factory->getProviders($credentials);
105 include_once
'./Services/Authentication/classes/class.ilAuthStatus.php';
108 include_once
'./Services/Authentication/classes/Frontend/class.ilAuthFrontendFactory.php';
111 $frontend = $frontend_factory->getFrontend(
118 $frontend->authenticate();
120 switch ($status->getStatus()) {
137 $ilDB = $DIC[
'ilDB'];
139 if (isset(
$_GET[
'ecs_hash'])
or isset(
$_GET[
'ecs_hash_url'])) {
143 if (isset(
$_POST[
'auth_mode'])) {
145 return $_POST[
'auth_mode'];
149 include_once(
'./Services/Authentication/classes/class.ilAuthModeDetermination.php');
152 if (!$det->isManualSelection()
and $det->getCountActiveAuthModes() > 1) {
160 if ($a_db_handler !=
'') {
161 $db = &$a_db_handler;
166 $q =
"SELECT auth_mode FROM usr_data WHERE " .
167 "login = " .
$ilDB->quote($a_username);
176 $auth_mode = self::_getAuthMode(
$row->auth_mode, $db);
178 return in_array($auth_mode, self::_getActiveAuthModes()) ? $auth_mode :
AUTH_INACTIVE;
185 $ilDB = $DIC[
'ilDB'];
190 if ($a_db_handler !=
'') {
191 $db = &$a_db_handler;
195 if (strpos($a_auth_mode,
'_') !==
false) {
196 $auth_arr = explode(
'_', $a_auth_mode);
197 $auth_switch = $auth_arr[0];
199 $auth_switch = $a_auth_mode;
201 switch ($auth_switch) {
208 include_once
'./Services/LDAP/classes/class.ilLDAPServer.php';
213 include_once
'./Services/LTI/classes/InternalProvider/class.ilAuthProviderLTI.php';
233 require_once
'Services/Saml/classes/class.ilSamlIdp.php';
260 $ilias = $DIC[
'ilias'];
263 switch ((
int) $a_auth_key) {
270 include_once
'./Services/LDAP/classes/class.ilLDAPServer.php';
275 include_once
'./Services/LTI/classes/InternalProvider/class.ilAuthProviderLTI.php';
295 require_once
'Services/Saml/classes/class.ilSamlIdp.php';
326 $ilias = $DIC[
'ilias'];
333 include_once(
'Services/LDAP/classes/class.ilLDAPServer.php');
335 $modes[
'ldap_' . $sid] = (
AUTH_LDAP .
'_' . $sid);
338 include_once
'./Services/LTI/classes/InternalProvider/class.ilAuthProviderLTI.php';
366 include_once
'./Services/WebServices/ECS/classes/class.ilECSServerSettings.php';
371 require_once
'Services/Saml/classes/class.ilSamlIdp.php';
377 foreach (self::getAuthPlugins() as $pl) {
378 foreach ($pl->getAuthIds() as $auth_id) {
379 if ($pl->isAuthActive($auth_id)) {
380 $modes[$pl->getAuthName($auth_id)] = $auth_id;
404 foreach ($modes as $mode) {
406 include_once
'./Services/LTI/classes/InternalProvider/class.ilAuthProviderLTI.php';
422 require_once
'Services/Saml/classes/class.ilSamlIdp.php';
442 $ilDB = $DIC[
'ilDB'];
449 $r =
$ilDB->query(
"SELECT login FROM usr_data WHERE login = " .
450 $ilDB->quote($c_login));
451 if (
$r->numRows() > 0) {
453 $c_login = $a_login . $postfix;
464 include_once(
'Services/Radius/classes/class.ilRadiusSettings.php');
467 if ($rad_settings->isActive()) {
470 include_once(
'Services/LDAP/classes/class.ilLDAPServer.php');
486 foreach ($pl->getAuthIds() as $auth_id) {
487 if ($pl->getMultipleAuthModeOptions($auth_id)) {
505 include_once(
'Services/LDAP/classes/class.ilLDAPServer.php');
517 include_once(
'Services/Radius/classes/class.ilRadiusSettings.php');
519 if ($rad_settings->isActive()) {
527 $apache_settings =
new ilSetting(
'apache_auth');
541 $default = (int) $_REQUEST[
'auth_mode'] ? (
int) $_REQUEST[
'auth_mode'] :
$default;
546 foreach ($pls as $pl) {
547 $auths = $pl->getAuthIds();
548 foreach ($auths as $auth_id) {
549 $pl_auth_option = $pl->getMultipleAuthModeOptions($auth_id);
550 if ($pl_auth_option) {
591 include_once(
'Services/LDAP/classes/class.ilLDAPServer.php');
596 include_once
'./Services/LTI/classes/InternalProvider/class.ilAuthProviderLTI.php';
601 require_once
'Services/Saml/classes/class.ilSamlIdp.php';
611 foreach (self::getAuthPlugins() as $pl) {
612 foreach ($pl->getAuthIds() as $auth_id) {
613 if ($pl->isAuthActive($auth_id)
and $pl->isExternalAccountNameRequired($auth_id)) {
633 switch ((
int) $a_auth_mode) {
655 switch ($a_auth_mode) {
667 public static function isPasswordModificationHidden()
674 if (
$ilSetting->get(
'usr_settings_hide_password') ||
$ilSetting->get(
'usr_settings_disable_password')) {
692 switch ((
int) $a_authmode) {
708 require_once
'Services/Saml/classes/class.ilSamlIdp.php';
710 return $idp->isActive() &&
$idp->allowLocalAuthentication();
713 return $ilSetting->get(
"shib_auth_allow_local");
715 return $ilSetting->get(
"soap_auth_allow_local");
736 if (self::isPasswordModificationHidden()) {
742 switch ((
int) $a_authmode) {
753 require_once
'Services/Saml/classes/class.ilSamlIdp.php';
755 return $idp->isActive() &&
$idp->allowLocalAuthentication();
764 return $ilSetting->get(
"shib_auth_allow_local");
766 return $ilSetting->get(
"soap_auth_allow_local");
781 switch ((
int) $a_authmode) {
813 $pls =
$GLOBALS[
'DIC'][
'ilPluginAdmin']->getActivePluginsForSlot(
819 foreach ($pls as $pl) {
820 $pl_objs[] =
$GLOBALS[
'DIC'][
'ilPluginAdmin']->getPluginObject(
841 switch ((
int) $a_auth_key) {
843 include_once
'./Services/LDAP/classes/class.ilLDAPServer.php';
849 include_once
'./Services/LTI/classes/InternalProvider/class.ilAuthProviderLTI.php';
855 require_once
'Services/Saml/classes/class.ilSamlIdp.php';
858 return $idp->getEntityId();
861 $lng->loadLanguageModule(
'auth');
862 if (!empty($auth_name)) {
863 return $lng->txt(
'auth_' . $auth_name);
865 return $lng->txt(
'auth_' . self::_getAuthModeName($a_auth_key));
static getIdpIdByAuthMode($a_auth_mode)
const CONTEXT_STANDARD_FORM
static _hasMultipleAuthenticationMethods()
static _getServerList()
Get list of all configured servers.
static getKeyByAuthMode($a_auth_mode)
Get auth id by auth mode.
static getServerIdByAuthMode($a_auth_mode)
Get auth id by auth mode.
const STATUS_AUTHENTICATION_FAILED
static getInstance()
Get singleton instance.
static getAuthModeByKey($a_auth_key)
get auth mode by key
const AUTH_OPENID_CONNECT
static initSession()
Initialize session.
Factory for auth frontend classes.
static _generateLogin($a_login)
generate free login by starting with a default string and adding postfix numbers
if(!array_key_exists('StateId', $_REQUEST)) $id
static isAuthenticationForced()
Check if authentication is should be forced.
static getInstanceByIdpId($a_idp_id)
static lookupConsumer($a_sid)
Lookup consumer title.
static goToPublicSection()
go to public section
static supportsLocalPasswordValidation($a_authmode)
Check if local password validation is supported.
static _getActiveAuthModes()
static _getActiveServerList()
Get active server list.
static getAuthModeTranslation($a_auth_key, $auth_name='')
static _needsExternalAccountByAuthMode($a_auth_mode)
Check if chosen auth mode needs an external account entry.
static _getAuthMode($a_auth_mode, $a_db_handler='')
static _getAuthModeName($a_auth_key)
static getInstanceByServerId($a_server_id)
Get instance by server id.
static getInstance()
Get singleton instance.
static _allowPasswordModificationByAuthMode($a_auth_mode)
Allow password modification.
static utility functions used to manage authentication modes
static getAuthPlugins()
Get active enabled auth plugins.
static handleForcedAuthentication()
static getActiveAuthModes()
get all active authmode server ids
static _getMultipleAuthModeOptions($lng)
static _getInstance()
singleton get instance
static setContext($a_context)
set context
static _isExternalAccountEnabled()
Check if an external account name is required.
static getServerIdByAuthMode($a_auth_mode)
Get auth id by auth mode.
const STATUS_AUTHENTICATED
static getKeyByAuthMode($a_auth_mode)
Get auth id by auth mode.
static isLocalPasswordEnabledForAuthMode($a_authmode)
Check if local password validation is enabled for a specific auth_mode.
static _getAllAuthModes()
static _getAuthModeOfUser($a_username, $a_password, $a_db_handler='')
static _getInstance()
Get instance.
static getAuthModeByKey($a_auth_key)
Get auth mode by key.
static getKeyByAuthMode($a_auth_mode)
static getAuthModeByKey($a_auth_key)
static getInstance()
Get status instance.
static getLogger($a_component_id)
Get component logger.
static getActiveIdpList()
static isPasswordModificationEnabled($a_authmode)
Check if password modification is enabled.
Description of class class.
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.