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_OPENID_CONNECT', 15);
 
   24define(
"AUTH_INACTIVE", 18);
 
   26define(
'AUTH_MULTIPLE', 20);
 
   28define(
'AUTH_SESSION', 21);
 
   30define(
'AUTH_PROVIDER_LTI', 22);
 
   32define(
'AUTH_SOAP_NO_ILIAS_USER', -100);
 
   33define(
'AUTH_LDAP_NO_ILIAS_USER', -200);
 
   34define(
'AUTH_RADIUS_NO_ILIAS_USER', -300);
 
   39define(
'AUTH_APACHE_FAILED', -500);
 
   40define(
'AUTH_SAML_FAILED', -501);
 
   42define(
'AUTH_MODE_INACTIVE', -1000);
 
   46define(
'AUTH_SOAP_NO_ILIAS_USER_BUT_EMAIL', -101);
 
   47define(
'AUTH_CAS_NO_ILIAS_USER', -90);
 
   50define(
'AUTH_USER_WRONG_IP', -600);
 
   51define(
'AUTH_USER_INACTIVE', -601);
 
   52define(
'AUTH_USER_TIME_LIMIT_EXCEEDED', -602);
 
   53define(
'AUTH_USER_SIMULTANEOUS_LOGIN', -603);
 
   54define(
'AUTH_CAPTCHA_INVALID', -604);
 
   57include_once 
'./Services/Authentication/classes/class.ilAuthFactory.php';
 
   58require_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()) {
 
  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);
 
  178        return in_array($auth_mode, self::_getActiveAuthModes()) ? $auth_mode : 
AUTH_INACTIVE;
 
  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';
 
  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));
 
An exception for terminatinating execution or to throw for unit testing.
const AUTH_OPENID_CONNECT
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 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 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 _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()
Get singleton instance.
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['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.