7define(
"AUTH_LOCAL", 1);
9define(
"AUTH_RADIUS", 3);
10define(
"AUTH_SCRIPT", 4);
11define(
"AUTH_SHIBBOLETH", 5);
13define(
"AUTH_SOAP", 7);
15define(
"AUTH_HTTP", 8);
19define(
"AUTH_APACHE", 11);
20define(
"AUTH_SAML", 12);
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');
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);
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';
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';
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';
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');
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()) {
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;
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");
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");
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));
if(!isset( $_REQUEST[ 'ReturnTo'])) if(!isset($_REQUEST['AuthId'])) $options
An exception for terminatinating execution or to throw for unit testing.
static setContext($a_context)
set context
Description of class class.
Factory for auth frontend classes.
const CONTEXT_STANDARD_FORM
static _getInstance()
Get instance.
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 _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 initSession()
Initialize session.
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 _getAuthModeOfUser($a_username, $a_password, $a_db_handler='')
static _getMultipleAuthModeOptions($lng)
static _isExternalAccountEnabled()
Check if an external account name is required.
static getAuthPlugins()
Get active enabled auth plugins.
static getAuthModeTranslation($a_auth_key)
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 getLogger($a_component_id)
Get component logger.
static _getInstance()
singleton get instance
static getKeyByAuthMode($a_auth_mode)
static getActiveIdpList()
static getInstanceByIdpId($a_idp_id)
static getIdpIdByAuthMode($a_auth_mode)
static getAuthModeByKey($a_auth_key)
if(!array_key_exists('StateId', $_REQUEST)) $id
$GLOBALS['loaded']
Global hash that tracks already loaded includes.