ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilAuthProviderFactory Class Reference

Auth provider factory. More...

+ Collaboration diagram for ilAuthProviderFactory:

Public Member Functions

 __construct ()
 Constructor. More...
 
 getLogger ()
 Get current logger. More...
 
 getProviders (ilAuthCredentials $credentials)
 Get provider. More...
 
 getProviderByAuthMode (ilAuthCredentials $credentials, $a_authmode)
 Get provider by auth mode. More...
 

Private Attributes

 $logger = null
 

Detailed Description

Auth provider factory.

Author
Stefan Meyer smeye.nosp@m.r.il.nosp@m.ias@g.nosp@m.mx.d.nosp@m.e

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

Constructor & Destructor Documentation

◆ __construct()

ilAuthProviderFactory::__construct ( )

Constructor.

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

References ilLoggerFactory\getLogger().

20  {
21  $this->logger = ilLoggerFactory::getLogger('auth');
22  }
static getLogger($a_component_id)
Get component logger.
+ Here is the call graph for this function:

Member Function Documentation

◆ getLogger()

ilAuthProviderFactory::getLogger ( )

Get current logger.

Returns

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

References $logger.

Referenced by getProviderByAuthMode(), and getProviders().

+ Here is the caller graph for this function:

◆ getProviderByAuthMode()

ilAuthProviderFactory::getProviderByAuthMode ( ilAuthCredentials  $credentials,
  $a_authmode 
)

Get provider by auth mode.

Returns

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

References PHPMailer\PHPMailer\$provider, AUTH_APACHE, AUTH_CAS, AUTH_ECS, AUTH_LDAP, AUTH_LOCAL, AUTH_OPENID_CONNECT, AUTH_PROVIDER_LTI, AUTH_RADIUS, AUTH_SAML, AUTH_SHIBBOLETH, AUTH_SOAP, ilAuthUtils\getAuthPlugins(), ilSamlIdp\getIdpIdByAuthMode(), and getLogger().

Referenced by getProviders().

66  {
67  switch ((int) $a_authmode) {
68  case AUTH_LDAP:
69  $ldap_info = explode('_', $a_authmode);
70  $this->getLogger()->debug('Using ldap authentication with credentials ');
71  include_once './Services/LDAP/classes/class.ilAuthProviderLDAP.php';
72  return new ilAuthProviderLDAP($credentials, $ldap_info[1]);
73 
74  case AUTH_LOCAL:
75  $this->getLogger()->debug('Using local database authentication');
76  include_once './Services/Authentication/classes/Provider/class.ilAuthProviderDatabase.php';
77  return new ilAuthProviderDatabase($credentials);
78 
79  case AUTH_SOAP:
80  $this->getLogger()->debug('Using SOAP authentication.');
81  include_once './Services/SOAPAuth/classes/class.ilAuthProviderSoap.php';
82  return new ilAuthProviderSoap($credentials);
83 
84  case AUTH_APACHE:
85  $this->getLogger()->debug('Using apache authentication.');
86  include_once './Services/AuthApache/classes/class.ilAuthProviderApache.php';
87  return new ilAuthProviderApache($credentials);
88 
89  case AUTH_CAS:
90  $this->getLogger()->debug('Using CAS authentication');
91  include_once './Services/CAS/classes/class.ilAuthProviderCAS.php';
92  return new ilAuthProviderCAS($credentials);
93 
94  case AUTH_RADIUS:
95  $this->getLogger()->debug('Using radius authentication.');
96  include_once './Services/Radius/classes/class.ilAuthProviderRadius.php';
97  return new ilAuthProviderRadius($credentials);
98 
99  case AUTH_SHIBBOLETH:
100  $this->getLogger()->debug('Using shibboleth authentication.');
101  include_once './Services/AuthShibboleth/classes/class.ilAuthProviderShibboleth.php';
102  return new ilAuthProviderShibboleth($credentials);
103 
104  case AUTH_PROVIDER_LTI:
105  $this->getLogger()->debug('Using lti provider authentication.');
106  include_once './Services/LTI/classes/InternalProvider/class.ilAuthProviderLTI.php';
107  return new ilAuthProviderLTI($credentials);
108 
109  case AUTH_ECS:
110  $this->getLogger()->debug('Using ecs authentication.');
111  include_once './Services/WebServices/ECS/classes/class.ilAuthProviderECS.php';
112  return new ilAuthProviderECS($credentials);
113 
114  case AUTH_SAML:
115  $this->getLogger()->debug('Using apache authentication.');
116  require_once 'Services/Saml/classes/class.ilAuthProviderSaml.php';
117  require_once 'Services/Saml/classes/class.ilSamlIdp.php';
118  return new ilAuthProviderSaml($credentials, ilSamlIdp::getIdpIdByAuthMode($a_authmode));
119 
120  case AUTH_OPENID_CONNECT:
121  $this->getLogger()->debug('Using openid connect authentication.');
122  return new ilAuthProviderOpenIdConnect($credentials);
123 
124  default:
125  $this->getLogger('Plugin authentication: ' . $a_authmode);
126  foreach (ilAuthUtils::getAuthPlugins() as $pl) {
127  $provider = $pl->getProvider($credentials, $a_authmode);
128  if ($provider instanceof ilAuthProviderInterface) {
129  return $provider;
130  }
131  }
132  break;
133  }
134  return null;
135  }
static getIdpIdByAuthMode($a_auth_mode)
CAS authentication provider.
const AUTH_LDAP
const AUTH_OPENID_CONNECT
Description of class class.
const AUTH_CAS
const AUTH_SHIBBOLETH
Class ilAuthProviderSoap.
const AUTH_APACHE
const AUTH_SAML
Description of class class.
Description of class class.
static getAuthPlugins()
Get active enabled auth plugins.
Standard interface for auth provider implementations.
Auth prvider for ecs auth.
Class ilAuthProviderOpenIdConnect.
const AUTH_ECS
const AUTH_LOCAL
OAuth based lti authentication.
Class ilAuthProviderSaml.
const AUTH_SOAP
Shibboleth authentication provider.
const AUTH_PROVIDER_LTI
const AUTH_RADIUS
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getProviders()

ilAuthProviderFactory::getProviders ( ilAuthCredentials  $credentials)

Get provider.

Parameters
\ilAuthCredentials$credentials

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

References PHPMailer\PHPMailer\$provider, ilAuthModeDetermination\_getInstance(), ilAuthCredentials\getAuthMode(), getLogger(), getProviderByAuthMode(), and ilAuthCredentials\getUsername().

38  {
39  // Fixed provider selection;
40  if (strlen($credentials->getAuthMode())) {
41  $this->getLogger()->debug('Returning fixed provider for auth mode: ' . $credentials->getAuthMode());
42  return array(
43  $this->getProviderByAuthMode($credentials, $credentials->getAuthMode())
44  );
45  }
46 
47  include_once './Services/Authentication/classes/class.ilAuthModeDetermination.php';
48  $auth_determination = ilAuthModeDetermination::_getInstance();
49  $sequence = $auth_determination->getAuthModeSequence($credentials->getUsername());
50 
51  $providers = array();
52  foreach ((array) $sequence as $position => $authmode) {
53  $provider = $this->getProviderByAuthMode($credentials, $authmode);
54  if ($provider instanceof ilAuthProviderInterface) {
55  $providers[] = $provider;
56  }
57  }
58  return $providers;
59  }
getUsername()
Get username.
Standard interface for auth provider implementations.
getAuthMode()
Get auth mode.
getProviderByAuthMode(ilAuthCredentials $credentials, $a_authmode)
Get provider by auth mode.
+ Here is the call graph for this function:

Field Documentation

◆ $logger

ilAuthProviderFactory::$logger = null
private

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

Referenced by getLogger().


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