ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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.

26 {
27 global $DIC;
28 $this->logger = $DIC->logger()->auth();
29 }
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 61 of file class.ilAuthProviderFactory.php.

62 {
63 switch ((int) $a_authmode) {
65 $ldap_info = explode('_', $a_authmode);
66 $this->logger->debug('Using ldap authentication with credentials ');
67 return new ilAuthProviderLDAP($credentials, (int) $ldap_info[1]);
68
70 $this->logger->debug('Using local database authentication');
71 return new ilAuthProviderDatabase($credentials);
72
74 $this->logger->debug('Using SOAP authentication.');
75 return new ilAuthProviderSoap($credentials);
76
78 $this->logger->debug('Using apache authentication.');
79 return new ilAuthProviderApache($credentials);
80
82 $this->logger->debug('Using shibboleth authentication.');
83 return new ilAuthProviderShibboleth($credentials);
84
86 $this->logger->debug('Using lti provider authentication.');
87 return new ilAuthProviderLTI($credentials);
88
90 $this->logger->debug('Using ecs authentication.');
91 return new ilAuthProviderECS($credentials);
92
94 $this->logger->debug('Using apache authentication.');
95 return new ilAuthProviderSaml($credentials, ilSamlIdp::getIdpIdByAuthMode($a_authmode));
96
98 $this->logger->debug('Using openid connect authentication.');
99 return new ilAuthProviderOpenIdConnect($credentials);
100
101 default:
102 $this->logger->debug('Plugin authentication: ' . $a_authmode);
103 foreach (ilAuthUtils::getAuthPlugins() as $pl) {
104 $provider = $pl->getProvider($credentials, $a_authmode);
105 if ($provider instanceof ilAuthProviderInterface) {
106 return $provider;
107 }
108 }
109 break;
110 }
111
112 return null;
113 }
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 34 of file class.ilAuthProviderFactory.php.

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 $authmode) {
49 $provider = $this->getProviderByAuthMode($credentials, (string) $authmode);
50 if ($provider instanceof ilAuthProviderInterface) {
51 $providers[] = $provider;
52 }
53 }
54
55 return $providers;
56 }
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 23 of file class.ilAuthProviderFactory.php.


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