ILIAS  trunk Revision v11.0_alpha-1749-g1a06bdef097
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilAuthProviderFactory Class Reference
+ Inheritance diagram for ilAuthProviderFactory:
+ Collaboration diagram for ilAuthProviderFactory:

Public Member Functions

 __construct ()
 
 getProviders (ilAuthCredentials $credentials)
 
 getProviderByAuthMode (ilAuthCredentials $credentials, $a_authmode)
 

Private Attributes

ilLogger $logger
 

Detailed Description

Definition at line 21 of file class.ilAuthProviderFactory.php.

Constructor & Destructor Documentation

◆ __construct()

ilAuthProviderFactory::__construct ( )

Definition at line 25 of file class.ilAuthProviderFactory.php.

References $DIC, and ILIAS\Repository\logger().

26  {
27  global $DIC;
28  $this->logger = $DIC->logger()->auth();
29  }
global $DIC
Definition: shib_login.php:22
+ Here is the call graph for this function:

Member Function Documentation

◆ getProviderByAuthMode()

ilAuthProviderFactory::getProviderByAuthMode ( ilAuthCredentials  $credentials,
  $a_authmode 
)
Parameters
string | int$a_authmode

Definition at line 60 of file class.ilAuthProviderFactory.php.

References $provider, ilAuthUtils\AUTH_APACHE, ilAuthUtils\AUTH_CAS, ilAuthUtils\AUTH_ECS, ilAuthUtils\AUTH_LDAP, ilAuthUtils\AUTH_LOCAL, ilAuthUtils\AUTH_OPENID_CONNECT, ilAuthUtils\AUTH_PROVIDER_LTI, ilAuthUtils\AUTH_SAML, ilAuthUtils\AUTH_SHIBBOLETH, ilAuthUtils\AUTH_SOAP, ilAuthUtils\getAuthPlugins(), ilSamlIdp\getIdpIdByAuthMode(), ILIAS\Repository\logger(), and null.

Referenced by ilAuthProviderCliFactory\getProviders(), and getProviders().

61  {
62  switch ((int) $a_authmode) {
64  $ldap_info = explode('_', $a_authmode);
65  $this->logger->debug('Using ldap authentication with credentials ');
66  return new ilAuthProviderLDAP($credentials, (int) $ldap_info[1]);
67 
69  $this->logger->debug('Using local database authentication');
70  return new ilAuthProviderDatabase($credentials);
71 
73  $this->logger->debug('Using SOAP authentication.');
74  return new ilAuthProviderSoap($credentials);
75 
77  $this->logger->debug('Using apache authentication.');
78  return new ilAuthProviderApache($credentials);
79 
81  $this->logger->debug('Using CAS authentication');
82  return new ilAuthProviderCAS($credentials);
83 
85  $this->logger->debug('Using shibboleth authentication.');
86  return new ilAuthProviderShibboleth($credentials);
87 
89  $this->logger->debug('Using lti provider authentication.');
90  return new ilAuthProviderLTI($credentials);
91 
93  $this->logger->debug('Using ecs authentication.');
94  return new ilAuthProviderECS($credentials);
95 
97  $this->logger->debug('Using apache authentication.');
98  return new ilAuthProviderSaml($credentials, ilSamlIdp::getIdpIdByAuthMode($a_authmode));
99 
101  $this->logger->debug('Using openid connect authentication.');
102  return new ilAuthProviderOpenIdConnect($credentials);
103 
104  default:
105  $this->logger->debug('Plugin authentication: ' . $a_authmode);
106  foreach (ilAuthUtils::getAuthPlugins() as $pl) {
107  $provider = $pl->getProvider($credentials, $a_authmode);
108  if ($provider instanceof ilAuthProviderInterface) {
109  return $provider;
110  }
111  }
112  break;
113  }
114 
115  return null;
116  }
const AUTH_OPENID_CONNECT
CAS authentication provider.
static getIdpIdByAuthMode(string $a_auth_mode)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
static getAuthPlugins()
Get active enabled auth plugins.
$provider
Definition: ltitoken.php:80
Standard interface for auth provider implementations.
Auth prvider for ecs auth.
OAuth based lti authentication.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getProviders()

ilAuthProviderFactory::getProviders ( ilAuthCredentials  $credentials)
Returns
list<ilAuthProviderInterface>

Definition at line 34 of file class.ilAuthProviderFactory.php.

References $provider, ilAuthModeDetermination\_getInstance(), ilAuthCredentials\getAuthMode(), getProviderByAuthMode(), ilAuthCredentials\getUsername(), and ILIAS\Repository\logger().

34  : array
35  {
36  // Fixed provider selection;
37  if ($credentials->getAuthMode() !== '') {
38  $this->logger->debug('Returning fixed provider for auth mode: ' . $credentials->getAuthMode());
39  return [
40  $this->getProviderByAuthMode($credentials, $credentials->getAuthMode())
41  ];
42  }
43 
44  $auth_determination = ilAuthModeDetermination::_getInstance();
45  $sequence = $auth_determination->getAuthModeSequence($credentials->getUsername());
46 
47  $providers = [];
48  foreach ($sequence as $position => $authmode) {
49  $provider = $this->getProviderByAuthMode($credentials, (string) $authmode);
50  if ($provider instanceof ilAuthProviderInterface) {
51  $providers[] = $provider;
52  }
53  }
54  return $providers;
55  }
getUsername()
Get username.
$provider
Definition: ltitoken.php:80
Standard interface for auth provider implementations.
getAuthMode()
Get auth mode.
getProviderByAuthMode(ilAuthCredentials $credentials, $a_authmode)
+ Here is the call graph for this function:

Field Documentation

◆ $logger

ilLogger ilAuthProviderFactory::$logger
private

Definition at line 23 of file class.ilAuthProviderFactory.php.


The documentation for this class was generated from the following file: