ILIAS  trunk Revision v12.0_alpha-377-g3641b37b9db
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 23 of file class.ilAuthProviderFactory.php.

Constructor & Destructor Documentation

◆ __construct()

ilAuthProviderFactory::__construct ( )

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

28 {
29 global $DIC;
30 $this->logger = $DIC->logger()->auth();
31 }
global $DIC
Definition: shib_login.php:26

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

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

64 {
65 switch ((int) $a_authmode) {
67 $ldap_info = explode('_', $a_authmode);
68 $this->logger->debug('Using ldap authentication with credentials ');
69 return new ilAuthProviderLDAP($credentials, (int) $ldap_info[1]);
70
72 $this->logger->debug('Using local database authentication');
73 return new ilAuthProviderDatabase($credentials);
74
76 $this->logger->debug('Using SOAP authentication.');
77 return new ilAuthProviderSoap($credentials);
78
80 $this->logger->debug('Using apache authentication.');
81 return new AuthProviderApache($credentials);
82
84 $this->logger->debug('Using shibboleth authentication.');
85 return new ilAuthProviderShibboleth($credentials);
86
88 $this->logger->debug('Using lti provider authentication.');
89 return new ilAuthProviderLTI($credentials);
90
92 $this->logger->debug('Using ecs authentication.');
93 return new ilAuthProviderECS($credentials);
94
96 $this->logger->debug('Using apache authentication.');
97 return new ilAuthProviderSaml($credentials, ilSamlIdp::getIdpIdByAuthMode($a_authmode));
98
100 $this->logger->debug('Using openid connect authentication.');
101 return new ilAuthProviderOpenIdConnect($credentials);
102
103 default:
104 $this->logger->debug('Plugin authentication: ' . $a_authmode);
105 foreach (ilAuthUtils::getAuthPlugins() as $pl) {
106 $provider = $pl->getProvider($credentials, $a_authmode);
107 if ($provider instanceof ilAuthProviderInterface) {
108 return $provider;
109 }
110 }
111 break;
112 }
113
114 return null;
115 }
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...
const int AUTH_ECS
const int AUTH_SHIBBOLETH
const int AUTH_LOCAL
const int AUTH_LDAP
const int AUTH_SAML
const int AUTH_APACHE
static getAuthPlugins()
const int AUTH_SOAP
const int AUTH_OPENID_CONNECT
const int AUTH_PROVIDER_LTI
static getIdpIdByAuthMode(string $a_auth_mode)
$provider
Definition: ltitoken.php:80

References $provider, ilAuthUtils\AUTH_APACHE, 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 ilAuthProviderCliFactory\getProviders(), and getProviders().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getProviders()

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

Reimplemented in ilAuthProviderCliFactory.

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

36 : array
37 {
38 // Fixed provider selection;
39 if ($credentials->getAuthMode() !== '') {
40 $this->logger->debug('Returning fixed provider for auth mode: ' . $credentials->getAuthMode());
41 return [
42 $this->getProviderByAuthMode($credentials, $credentials->getAuthMode())
43 ];
44 }
45
46 $auth_determination = ilAuthModeDetermination::_getInstance();
47 $sequence = $auth_determination->getAuthModeSequence($credentials->getUsername());
48
49 $providers = [];
50 foreach ($sequence as $authmode) {
51 $provider = $this->getProviderByAuthMode($credentials, (string) $authmode);
52 if ($provider instanceof ilAuthProviderInterface) {
53 $providers[] = $provider;
54 }
55 }
56
57 return $providers;
58 }
getProviderByAuthMode(ilAuthCredentials $credentials, $a_authmode)

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

+ Here is the call graph for this function:

Field Documentation

◆ $logger

ilLogger ilAuthProviderFactory::$logger
private

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


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