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_INACTIVE", 18);
24 define(
'AUTH_MULTIPLE', 20);
26 define(
'AUTH_SESSION', 21);
28 define(
'AUTH_PROVIDER_LTI', 22);
30 define(
'AUTH_SOAP_NO_ILIAS_USER', -100);
31 define(
'AUTH_LDAP_NO_ILIAS_USER', -200);
32 define(
'AUTH_RADIUS_NO_ILIAS_USER', -300);
37 define(
'AUTH_APACHE_FAILED', -500);
38 define(
'AUTH_SAML_FAILED', -501);
40 define(
'AUTH_MODE_INACTIVE', -1000);
44 define(
'AUTH_SOAP_NO_ILIAS_USER_BUT_EMAIL', -101);
45 define(
'AUTH_CAS_NO_ILIAS_USER', -90);
48 define(
'AUTH_USER_WRONG_IP', -600);
49 define(
'AUTH_USER_INACTIVE', -601);
50 define(
'AUTH_USER_TIME_LIMIT_EXCEEDED', -602);
51 define(
'AUTH_USER_SIMULTANEOUS_LOGIN', -603);
52 define(
'AUTH_CAPTCHA_INVALID', -604);
55 include_once
'./Services/Authentication/classes/class.ilAuthFactory.php';
56 require_once(
'Services/Authentication/classes/class.ilSessionControl.php');
85 if (isset(
$_GET[
'ecs_hash']) or isset(
$_GET[
'ecs_hash_url'])) {
93 if (isset(
$_GET[
'ecs_hash']) or isset(
$_GET[
'ecs_hash_url'])) {
94 include_once
'./Services/Authentication/classes/Frontend/class.ilAuthFrontendCredentials.php';
96 $credentials->setUsername(
$_GET[
'ecs_login']);
99 include_once
'./Services/Authentication/classes/Provider/class.ilAuthProviderFactory.php';
101 $providers = $provider_factory->getProviders($credentials);
103 include_once
'./Services/Authentication/classes/class.ilAuthStatus.php';
106 include_once
'./Services/Authentication/classes/Frontend/class.ilAuthFrontendFactory.php';
109 $frontend = $frontend_factory->getFrontend(
116 $frontend->authenticate();
118 switch ($status->getStatus()) {
135 if (isset(
$_GET[
'ecs_hash']) or isset(
$_GET[
'ecs_hash_url'])) {
139 if (isset(
$_POST[
'auth_mode'])) {
141 return $_POST[
'auth_mode'];
145 include_once(
'./Services/Authentication/classes/class.ilAuthModeDetermination.php');
148 if (!$det->isManualSelection() and $det->getCountActiveAuthModes() > 1) {
156 if ($a_db_handler !=
'') {
162 $q =
"SELECT auth_mode FROM usr_data WHERE " .
163 "login = " . $ilDB->quote($a_username);
172 $auth_mode = self::_getAuthMode(
$row->auth_mode, $db);
174 return in_array($auth_mode, self::_getActiveAuthModes()) ? $auth_mode :
AUTH_INACTIVE;
183 if ($a_db_handler !=
'') {
188 if (strpos($a_auth_mode,
'_') !==
false) {
189 $auth_arr = explode(
'_', $a_auth_mode);
190 $auth_switch = $auth_arr[0];
192 $auth_switch = $a_auth_mode;
194 switch ($auth_switch) {
201 include_once
'./Services/LDAP/classes/class.ilLDAPServer.php';
206 include_once
'./Services/LTI/classes/InternalProvider/class.ilAuthProviderLTI.php';
222 require_once
'Services/Saml/classes/class.ilSamlIdp.php';
240 return $ilSetting->get(
"auth_mode");
250 switch ((
int) $a_auth_key) {
257 include_once
'./Services/LDAP/classes/class.ilLDAPServer.php';
262 include_once
'./Services/LTI/classes/InternalProvider/class.ilAuthProviderLTI.php';
282 require_once
'Services/Saml/classes/class.ilSamlIdp.php';
310 'default' => $ilSetting->get(
"auth_mode"),
313 include_once(
'Services/LDAP/classes/class.ilLDAPServer.php');
316 $modes[
'ldap_' . $sid] = (
AUTH_LDAP .
'_' . $sid);
319 include_once
'./Services/LTI/classes/InternalProvider/class.ilAuthProviderLTI.php';
325 if ($ilSetting->get(
"radius_active")) {
328 if ($ilSetting->get(
"shib_active")) {
331 if ($ilSetting->get(
"script_active")) {
334 if ($ilSetting->get(
"cas_active")) {
337 if ($ilSetting->get(
"soap_auth_active")) {
340 if ($ilSetting->get(
"apache_active")) {
344 include_once
'./Services/WebServices/ECS/classes/class.ilECSServerSettings.php';
349 require_once
'Services/Saml/classes/class.ilSamlIdp.php';
355 foreach (self::getAuthPlugins() as $pl) {
356 foreach ($pl->getAuthIds() as $auth_id) {
357 if ($pl->isAuthActive($auth_id)) {
358 $modes[$pl->getAuthName($auth_id)] = $auth_id;
381 foreach ($modes as $mode) {
383 include_once
'./Services/LTI/classes/InternalProvider/class.ilAuthProviderLTI.php';
399 require_once
'Services/Saml/classes/class.ilSamlIdp.php';
424 $r = $ilDB->query(
"SELECT login FROM usr_data WHERE login = " .
425 $ilDB->quote($c_login));
426 if (
$r->numRows() > 0) {
428 $c_login = $a_login . $postfix;
439 include_once(
'Services/Radius/classes/class.ilRadiusSettings.php');
442 if ($rad_settings->isActive()) {
445 include_once(
'Services/LDAP/classes/class.ilLDAPServer.php');
453 if ($ilSetting->get(
'apache_active')) {
459 foreach ($pl->getAuthIds() as $auth_id) {
460 if ($pl->getMultipleAuthModeOptions($auth_id)) {
476 include_once(
'Services/LDAP/classes/class.ilLDAPServer.php');
488 include_once(
'Services/Radius/classes/class.ilRadiusSettings.php');
490 if ($rad_settings->isActive()) {
494 if ($ilSetting->get(
'apache_active')) {
496 $apache_settings =
new ilSetting(
'apache_auth');
509 $default = $ilSetting->get(
'default_auth_mode', $default);
510 $default = (int) $_REQUEST[
'auth_mode'] ? (
int) $_REQUEST[
'auth_mode'] : $default;
515 foreach ($pls as $pl) {
516 $auths = $pl->getAuthIds();
517 foreach ($auths as $auth_id) {
518 $pl_auth_option = $pl->getMultipleAuthModeOptions($auth_id);
519 if ($pl_auth_option) {
526 if (array_key_exists($default,
$options)) {
527 $options[$default][
'checked'] =
true;
546 if ($ilSetting->get(
"cas_active")) {
549 if ($ilSetting->get(
"soap_auth_active")) {
552 if ($ilSetting->get(
"shib_active")) {
555 if ($ilSetting->get(
'radius_active')) {
558 include_once(
'Services/LDAP/classes/class.ilLDAPServer.php');
563 include_once
'./Services/LTI/classes/InternalProvider/class.ilAuthProviderLTI.php';
568 require_once
'Services/Saml/classes/class.ilSamlIdp.php';
574 foreach (self::getAuthPlugins() as $pl) {
575 foreach ($pl->getAuthIds() as $auth_id) {
576 if ($pl->isAuthActive($auth_id) and $pl->isExternalAccountNameRequired($auth_id)) {
598 switch ((
int) $a_auth_mode) {
619 switch ($a_auth_mode) {
631 public static function isPasswordModificationHidden()
636 if ($ilSetting->get(
'usr_settings_hide_password') || $ilSetting->get(
'usr_settings_disable_password')) {
652 switch ((
int) $a_authmode) {
667 require_once
'Services/Saml/classes/class.ilSamlIdp.php';
669 return $idp->isActive() &&
$idp->allowLocalAuthentication();
672 return $ilSetting->get(
"shib_auth_allow_local");
674 return $ilSetting->get(
"soap_auth_allow_local");
676 return $ilSetting->get(
"cas_allow_local");
693 if (self::isPasswordModificationHidden()) {
699 switch ((
int) $a_authmode) {
709 require_once
'Services/Saml/classes/class.ilSamlIdp.php';
711 return $idp->isActive() &&
$idp->allowLocalAuthentication();
720 return $ilSetting->get(
"shib_auth_allow_local");
722 return $ilSetting->get(
"soap_auth_allow_local");
724 return $ilSetting->get(
"cas_allow_local");
737 switch ((
int) $a_authmode) {
768 $pls =
$GLOBALS[
'ilPluginAdmin']->getActivePluginsForSlot(
774 foreach ($pls as $pl) {
775 $pl_objs[] =
$GLOBALS[
'ilPluginAdmin']->getPluginObject(
794 switch ((
int) $a_auth_key) {
796 include_once
'./Services/LDAP/classes/class.ilLDAPServer.php';
802 include_once
'./Services/LTI/classes/InternalProvider/class.ilAuthProviderLTI.php';
808 require_once
'Services/Saml/classes/class.ilSamlIdp.php';
811 return $idp->getEntityId();
814 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
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
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
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 _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 _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.
Create styles array
The data for the language used.
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 getAuthModeTranslation($a_auth_key)
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.
if(!isset($_REQUEST['ReturnTo'])) if(!isset($_REQUEST['AuthId'])) $options