ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilAuthProviderFactory Class Reference

Auth provider factory. More...

+ Collaboration diagram for ilAuthProviderFactory:

Public Member Functions

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

Private Attributes

ilLogger $logger
 

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 27 of file class.ilAuthProviderFactory.php.

Constructor & Destructor Documentation

◆ __construct()

ilAuthProviderFactory::__construct ( )

Constructor.

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

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

35  {
36  global $DIC;
37  $this->logger = $DIC->logger()->auth();
38  }
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:

Member Function Documentation

◆ getProviderByAuthMode()

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

Get provider by auth mode.

Definition at line 69 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(), and ILIAS\Repository\logger().

Referenced by getProviders().

70  {
71  switch ((int) $a_authmode) {
73  $ldap_info = explode('_', $a_authmode);
74  $this->logger->debug('Using ldap authentication with credentials ');
75  return new ilAuthProviderLDAP($credentials, (int) $ldap_info[1]);
76 
78  $this->logger->debug('Using local database authentication');
79  return new ilAuthProviderDatabase($credentials);
80 
82  $this->logger->debug('Using SOAP authentication.');
83  return new ilAuthProviderSoap($credentials);
84 
86  $this->logger->debug('Using apache authentication.');
87  return new ilAuthProviderApache($credentials);
88 
90  $this->logger->debug('Using CAS authentication');
91  return new ilAuthProviderCAS($credentials);
92 
94  $this->logger->debug('Using shibboleth authentication.');
95  return new ilAuthProviderShibboleth($credentials);
96 
98  $this->logger->debug('Using lti provider authentication.');
99  return new ilAuthProviderLTI($credentials);
100 
102  $this->logger->debug('Using ecs authentication.');
103  return new ilAuthProviderECS($credentials);
104 
106  $this->logger->debug('Using apache authentication.');
107  return new ilAuthProviderSaml($credentials, ilSamlIdp::getIdpIdByAuthMode($a_authmode));
108 
110  $this->logger->debug('Using openid connect authentication.');
111  return new ilAuthProviderOpenIdConnect($credentials);
112 
113  default:
114  $this->logger->debug('Plugin authentication: ' . $a_authmode);
115  foreach (ilAuthUtils::getAuthPlugins() as $pl) {
116  $provider = $pl->getProvider($credentials, $a_authmode);
117  if ($provider instanceof ilAuthProviderInterface) {
118  return $provider;
119  }
120  }
121  break;
122  }
123  return null;
124  }
const AUTH_OPENID_CONNECT
CAS authentication provider.
Class ilAuthProviderSoap.
static getIdpIdByAuthMode(string $a_auth_mode)
static getAuthPlugins()
Get active enabled auth plugins.
$provider
Definition: ltitoken.php:83
Standard interface for auth provider implementations.
Auth prvider for ecs auth.
Class ilAuthProviderOpenIdConnect.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ilAuthProviderSaml.
Shibboleth authentication provider.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getProviders()

ilAuthProviderFactory::getProviders ( ilAuthCredentials  $credentials)

Get provider.

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

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

43  : array
44  {
45  // Fixed provider selection;
46  if ($credentials->getAuthMode() !== '') {
47  $this->logger->debug('Returning fixed provider for auth mode: ' . $credentials->getAuthMode());
48  return array(
49  $this->getProviderByAuthMode($credentials, $credentials->getAuthMode())
50  );
51  }
52 
53  $auth_determination = ilAuthModeDetermination::_getInstance();
54  $sequence = $auth_determination->getAuthModeSequence($credentials->getUsername());
55 
56  $providers = array();
57  foreach ($sequence as $position => $authmode) {
58  $provider = $this->getProviderByAuthMode($credentials, (string) $authmode);
59  if ($provider instanceof ilAuthProviderInterface) {
60  $providers[] = $provider;
61  }
62  }
63  return $providers;
64  }
getUsername()
Get username.
$provider
Definition: ltitoken.php:83
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

ilLogger ilAuthProviderFactory::$logger
private

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


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