ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilOpenIdConnectSettings Class Reference
+ Collaboration diagram for ilOpenIdConnectSettings:

Public Member Functions

 setActive (bool $active)
 
 getActive ()
 
 setProvider (string $url)
 
 getProvider ()
 
 setClientId (string $client_id)
 
 getClientId ()
 
 setSecret (string $secret)
 
 getSecret ()
 
 setLoginElementType (int $type)
 
 getLoginElementType ()
 
 setLoginElementImage (string $a_img_name)
 
 getLoginElementImage ()
 
 setLoginElementText (string $text)
 
 getLoginElemenText ()
 
 setLoginPromptType (int $a_type)
 
 getLoginPromptType ()
 
 setLogoutScope (int $a_scope)
 
 getLogoutScope ()
 
 useCustomSession (bool $a_stat)
 
 isCustomSession ()
 
 setSessionDuration (int $a_duration)
 
 getSessionDuration ()
 
 isSyncAllowed ()
 
 allowSync (bool $a_stat)
 
 setRole (int $role)
 
 getRole ()
 
 setUidField (string $field)
 
 getUidField ()
 
 getAdditionalScopes ()
 
 setAdditionalScopes (array $additional_scopes)
 
 getAllScopes ()
 
 deleteImageFile ()
 
 hasImageFile ()
 
 getImageFilePath ()
 
 setRoleMappings (array $a_role_mappings)
 
 getRoleMappings ()
 
 getRoleMappingValueForId (int $a_role_id)
 
 getRoleMappingUpdateForId (int $a_role_id)
 
 validateScopes (string $discoveryURL, array $custom_scopes)
 
 save ()
 
 getProfileMappingFieldValue (string $field)
 
 setProfileMappingFieldValue (string $field, string $value)
 
 getProfileMappingFieldUpdate (string $field)
 
 setProfileMappingFieldUpdate (string $field, bool $value)
 
 setValidateScopes (int $validation_mode)
 
 getValidateScopes ()
 
 setCustomDiscoveryUrl (?string $discoveryUrl)
 
 getCustomDiscoveryUrl ()
 
 getProfileMappingFields ()
 

Static Public Member Functions

static getInstance ()
 

Data Fields

const FILE_STORAGE = 'openidconnect/login_form_image'
 
const DEFAULT_SCOPE = 'openid'
 
const LOGIN_ELEMENT_TYPE_TXT = 0
 
const LOGIN_ELEMENT_TYPE_IMG = 1
 
const LOGIN_ENFORCE = 0
 
const LOGIN_STANDARD = 1
 
const LOGOUT_SCOPE_GLOBAL = 0
 
const LOGOUT_SCOPE_LOCAL = 1
 
const URL_VALIDATION_PROVIDER = 0
 
const URL_VALIDATION_CUSTOM = 1
 
const URL_VALIDATION_NONE = 2
 
const VALIDATION_ISSUE_INVALID_SCOPE = 0
 
const VALIDATION_ISSUE_DISCOVERY_ERROR = 1
 

Protected Member Functions

 load ()
 

Private Member Functions

 __construct ()
 

Private Attributes

const STORAGE_ID = 'oidc'
 
ilSetting $storage
 
Filesystem $filesystem
 
bool $active = false
 
string $provider = ''
 
string $client_id = ''
 
string $secret = ''
 
int $login_element_type = self::LOGIN_ELEMENT_TYPE_TXT
 
string $login_element_img_name = null
 
string $login_element_text = null
 
int $login_prompt_type = self::LOGIN_ENFORCE
 
int $logout_scope = null
 
bool $custom_session = false
 
int $session_duration = 60
 
bool $allow_sync
 
int $role
 
string $uid = ''
 
array $profile_map = []
 
array $profile_update_map = []
 
array $role_mappings = []
 
array $additional_scopes = []
 
int $validate_scopes = self::URL_VALIDATION_PROVIDER
 
string $custom_discovery_url = null
 

Static Private Attributes

static self $instance = null
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

ilOpenIdConnectSettings::__construct ( )
private

Definition at line 76 of file class.ilOpenIdConnectSettings.php.

References $DIC, ILIAS\Repository\filesystem(), and load().

77  {
78  global $DIC;
79 
80  $this->storage = new ilSetting(self::STORAGE_ID);
81  $this->filesystem = $DIC->filesystem()->web();
82  $this->load();
83  }
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:

Member Function Documentation

◆ allowSync()

ilOpenIdConnectSettings::allowSync ( bool  $a_stat)

Definition at line 210 of file class.ilOpenIdConnectSettings.php.

Referenced by load().

210  : void
211  {
212  $this->allow_sync = $a_stat;
213  }
+ Here is the caller graph for this function:

◆ deleteImageFile()

ilOpenIdConnectSettings::deleteImageFile ( )
Exceptions

Definition at line 267 of file class.ilOpenIdConnectSettings.php.

References ILIAS\Repository\filesystem(), and getLoginElementImage().

267  : void
268  {
269  if ($this->filesystem->has(self::FILE_STORAGE . '/' . $this->getLoginElementImage())) {
270  $this->filesystem->delete(self::FILE_STORAGE . '/' . $this->getLoginElementImage());
271  }
272  }
+ Here is the call graph for this function:

◆ getActive()

ilOpenIdConnectSettings::getActive ( )

Definition at line 99 of file class.ilOpenIdConnectSettings.php.

References $active.

Referenced by save().

99  : bool
100  {
101  return $this->active;
102  }
+ Here is the caller graph for this function:

◆ getAdditionalScopes()

ilOpenIdConnectSettings::getAdditionalScopes ( )
Returns
string[]

Definition at line 238 of file class.ilOpenIdConnectSettings.php.

References $additional_scopes.

Referenced by save().

238  : array
239  {
241  }
+ Here is the caller graph for this function:

◆ getAllScopes()

ilOpenIdConnectSettings::getAllScopes ( )
Returns
string[]

Definition at line 255 of file class.ilOpenIdConnectSettings.php.

References $additional_scopes, and $scopes.

255  : array
256  {
258  array_unshift($scopes, self::DEFAULT_SCOPE);
259 
260  return $scopes;
261  }
$scopes
Definition: ltitoken.php:99

◆ getClientId()

ilOpenIdConnectSettings::getClientId ( )

Definition at line 119 of file class.ilOpenIdConnectSettings.php.

References $client_id.

Referenced by save().

119  : string
120  {
121  return $this->client_id;
122  }
+ Here is the caller graph for this function:

◆ getCustomDiscoveryUrl()

ilOpenIdConnectSettings::getCustomDiscoveryUrl ( )

Definition at line 458 of file class.ilOpenIdConnectSettings.php.

References $custom_discovery_url.

Referenced by save().

458  : ?string
459  {
461  }
+ Here is the caller graph for this function:

◆ getImageFilePath()

ilOpenIdConnectSettings::getImageFilePath ( )

Definition at line 281 of file class.ilOpenIdConnectSettings.php.

References getLoginElementImage(), and ilFileUtils\getWebspaceDir().

281  : string
282  {
283  return implode(
284  '/',
285  [
287  self::FILE_STORAGE . '/' . $this->getLoginElementImage()
288  ]
289  );
290  }
static getWebspaceDir(string $mode="filesystem")
get webspace directory
+ Here is the call graph for this function:

◆ getInstance()

static ilOpenIdConnectSettings::getInstance ( )
static

Definition at line 85 of file class.ilOpenIdConnectSettings.php.

Referenced by ilAuthFrontendCredentialsOpenIdConnect\__construct(), ilAuthProviderOpenIdConnect\__construct(), ilOpenIdConnectSettingsGUI\__construct(), ilAuthUtils\_getActiveAuthModes(), ilAuthUtils\_isExternalAccountEnabled(), ilObjAuthSettingsGUI\authSettingsObject(), and ilStartUpGUI\showOpenIdConnectLoginForm().

85  : self
86  {
87  if (self::$instance === null) {
88  self::$instance = new self();
89  }
90 
91  return self::$instance;
92  }
+ Here is the caller graph for this function:

◆ getLoginElemenText()

ilOpenIdConnectSettings::getLoginElemenText ( )

Definition at line 160 of file class.ilOpenIdConnectSettings.php.

References $login_element_text.

Referenced by save().

160  : string
161  {
163  }
+ Here is the caller graph for this function:

◆ getLoginElementImage()

ilOpenIdConnectSettings::getLoginElementImage ( )

Definition at line 149 of file class.ilOpenIdConnectSettings.php.

References $login_element_img_name.

Referenced by deleteImageFile(), getImageFilePath(), hasImageFile(), and save().

149  : string
150  {
152  }
+ Here is the caller graph for this function:

◆ getLoginElementType()

ilOpenIdConnectSettings::getLoginElementType ( )

Definition at line 139 of file class.ilOpenIdConnectSettings.php.

References $login_element_type.

Referenced by save().

139  : int
140  {
142  }
+ Here is the caller graph for this function:

◆ getLoginPromptType()

ilOpenIdConnectSettings::getLoginPromptType ( )

Definition at line 170 of file class.ilOpenIdConnectSettings.php.

References $login_prompt_type.

Referenced by save().

170  : int
171  {
173  }
+ Here is the caller graph for this function:

◆ getLogoutScope()

ilOpenIdConnectSettings::getLogoutScope ( )

Definition at line 180 of file class.ilOpenIdConnectSettings.php.

References $logout_scope.

Referenced by save().

180  : int
181  {
182  return $this->logout_scope;
183  }
+ Here is the caller graph for this function:

◆ getProfileMappingFields()

ilOpenIdConnectSettings::getProfileMappingFields ( )
Returns
array<string, string>

Definition at line 465 of file class.ilOpenIdConnectSettings.php.

Referenced by load(), and save().

465  : array
466  {
467  return [
468  'firstname' => 'firstname',
469  'lastname' => 'lastname',
470  'email' => 'email',
471  'birthday' => 'birthday'
472  ];
473  }
+ Here is the caller graph for this function:

◆ getProfileMappingFieldUpdate()

ilOpenIdConnectSettings::getProfileMappingFieldUpdate ( string  $field)

Definition at line 433 of file class.ilOpenIdConnectSettings.php.

Referenced by save().

433  : bool
434  {
435  return (bool) ($this->profile_update_map[$field] ?? false);
436  }
+ Here is the caller graph for this function:

◆ getProfileMappingFieldValue()

ilOpenIdConnectSettings::getProfileMappingFieldValue ( string  $field)

Definition at line 423 of file class.ilOpenIdConnectSettings.php.

Referenced by save().

423  : string
424  {
425  return (string) ($this->profile_map[$field] ?? '');
426  }
+ Here is the caller graph for this function:

◆ getProvider()

ilOpenIdConnectSettings::getProvider ( )

Definition at line 109 of file class.ilOpenIdConnectSettings.php.

References $provider.

Referenced by save().

109  : string
110  {
111  return $this->provider;
112  }
+ Here is the caller graph for this function:

◆ getRole()

ilOpenIdConnectSettings::getRole ( )

Definition at line 220 of file class.ilOpenIdConnectSettings.php.

References $role.

Referenced by save().

220  : int
221  {
222  return $this->role;
223  }
+ Here is the caller graph for this function:

◆ getRoleMappings()

ilOpenIdConnectSettings::getRoleMappings ( )
Returns
array<int, array{value: string, update: bool}>

Definition at line 303 of file class.ilOpenIdConnectSettings.php.

References $role_mappings.

Referenced by save().

303  : array
304  {
305  return $this->role_mappings;
306  }
+ Here is the caller graph for this function:

◆ getRoleMappingUpdateForId()

ilOpenIdConnectSettings::getRoleMappingUpdateForId ( int  $a_role_id)

Definition at line 317 of file class.ilOpenIdConnectSettings.php.

317  : bool
318  {
319  if (isset($this->role_mappings[$a_role_id]['update'])) {
320  return (bool) $this->role_mappings[$a_role_id]['update'];
321  }
322 
323  return false;
324  }

◆ getRoleMappingValueForId()

ilOpenIdConnectSettings::getRoleMappingValueForId ( int  $a_role_id)

Definition at line 308 of file class.ilOpenIdConnectSettings.php.

308  : string
309  {
310  if (isset($this->role_mappings[$a_role_id]['value'])) {
311  return (string) $this->role_mappings[$a_role_id]['value'];
312  }
313 
314  return '';
315  }

◆ getSecret()

ilOpenIdConnectSettings::getSecret ( )

Definition at line 129 of file class.ilOpenIdConnectSettings.php.

References $secret.

Referenced by save().

129  : string
130  {
131  return $this->secret;
132  }
+ Here is the caller graph for this function:

◆ getSessionDuration()

ilOpenIdConnectSettings::getSessionDuration ( )

Definition at line 200 of file class.ilOpenIdConnectSettings.php.

References $session_duration.

Referenced by save().

200  : int
201  {
203  }
+ Here is the caller graph for this function:

◆ getUidField()

ilOpenIdConnectSettings::getUidField ( )

Definition at line 230 of file class.ilOpenIdConnectSettings.php.

References $uid.

Referenced by save().

230  : string
231  {
232  return $this->uid;
233  }
+ Here is the caller graph for this function:

◆ getValidateScopes()

ilOpenIdConnectSettings::getValidateScopes ( )

Definition at line 448 of file class.ilOpenIdConnectSettings.php.

References $validate_scopes.

Referenced by load(), and save().

448  : int
449  {
450  return $this->validate_scopes;
451  }
+ Here is the caller graph for this function:

◆ hasImageFile()

ilOpenIdConnectSettings::hasImageFile ( )

Definition at line 274 of file class.ilOpenIdConnectSettings.php.

References ILIAS\Repository\filesystem(), and getLoginElementImage().

274  : bool
275  {
276  return
277  $this->getLoginElementImage() !== '' &&
278  $this->filesystem->has(self::FILE_STORAGE . '/' . $this->getLoginElementImage());
279  }
+ Here is the call graph for this function:

◆ isCustomSession()

ilOpenIdConnectSettings::isCustomSession ( )

Definition at line 190 of file class.ilOpenIdConnectSettings.php.

References $custom_session.

Referenced by save().

190  : bool
191  {
192  return $this->custom_session;
193  }
+ Here is the caller graph for this function:

◆ isSyncAllowed()

ilOpenIdConnectSettings::isSyncAllowed ( )

Definition at line 205 of file class.ilOpenIdConnectSettings.php.

References $allow_sync.

Referenced by save().

205  : bool
206  {
207  return $this->allow_sync;
208  }
+ Here is the caller graph for this function:

◆ load()

ilOpenIdConnectSettings::load ( )
protected

Definition at line 388 of file class.ilOpenIdConnectSettings.php.

References allowSync(), getProfileMappingFields(), getValidateScopes(), setActive(), setAdditionalScopes(), setClientId(), setCustomDiscoveryUrl(), setLoginElementImage(), setLoginElementText(), setLoginElementType(), setLoginPromptType(), setLogoutScope(), setProvider(), setRole(), setRoleMappings(), setSecret(), setSessionDuration(), setUidField(), setValidateScopes(), and useCustomSession().

Referenced by __construct().

388  : void
389  {
390  foreach ($this->getProfileMappingFields() as $field => $lang_key) {
391  $this->profile_map[$field] = (string) $this->storage->get('pmap_' . $field, '');
392  $this->profile_update_map[$field] = (bool) $this->storage->get('pumap_' . $field, '0');
393  }
394 
395  $this->setActive((bool) $this->storage->get('active', '0'));
396  $this->setProvider($this->storage->get('provider', ''));
397  $this->setClientId($this->storage->get('client_id', ''));
398  $this->setSecret($this->storage->get('secret', ''));
399  $this->setAdditionalScopes((array) unserialize(
400  $this->storage->get('scopes', serialize([])),
401  ['allowed_classes' => false]
402  ));
403  $this->setLoginElementImage($this->storage->get('le_img', ''));
404  $this->setLoginElementText((string) $this->storage->get('le_text'));
405  $this->setLoginElementType((int) $this->storage->get('le_type'));
406  $this->setLoginPromptType((int) $this->storage->get('prompt_type', (string) self::LOGIN_ENFORCE));
407  $this->setLogoutScope((int) $this->storage->get('logout_scope', (string) self::LOGOUT_SCOPE_GLOBAL));
408  $this->useCustomSession((bool) $this->storage->get('custom_session', '0'));
409  $this->setSessionDuration((int) $this->storage->get('session_duration', '60'));
410  $this->allowSync((bool) $this->storage->get('allow_sync', '0'));
411  $this->setRole((int) $this->storage->get('role', '0'));
412  $this->setUidField((string) $this->storage->get('uid', ''));
413  $this->setRoleMappings((array) unserialize(
414  $this->storage->get('role_mappings', serialize([])),
415  ['allowed_classes' => false]
416  ));
417  $this->setValidateScopes((int) $this->storage->get('validate_scopes', (string) self::URL_VALIDATION_PROVIDER));
418  if (self::URL_VALIDATION_CUSTOM === $this->getValidateScopes()) {
419  $this->setCustomDiscoveryUrl($this->storage->get('custom_discovery_url'));
420  }
421  }
setCustomDiscoveryUrl(?string $discoveryUrl)
setRoleMappings(array $a_role_mappings)
setAdditionalScopes(array $additional_scopes)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ save()

ilOpenIdConnectSettings::save ( )

Definition at line 357 of file class.ilOpenIdConnectSettings.php.

References getActive(), getAdditionalScopes(), getClientId(), getCustomDiscoveryUrl(), getLoginElemenText(), getLoginElementImage(), getLoginElementType(), getLoginPromptType(), getLogoutScope(), getProfileMappingFields(), getProfileMappingFieldUpdate(), getProfileMappingFieldValue(), getProvider(), getRole(), getRoleMappings(), getSecret(), getSessionDuration(), getUidField(), getValidateScopes(), isCustomSession(), and isSyncAllowed().

357  : void
358  {
359  $this->storage->set('active', (string) ((int) $this->getActive()));
360  $this->storage->set('provider', $this->getProvider());
361  $this->storage->set('client_id', $this->getClientId());
362  $this->storage->set('secret', $this->getSecret());
363  $this->storage->set('scopes', serialize($this->getAdditionalScopes()));
364  $this->storage->set('le_img', $this->getLoginElementImage());
365  $this->storage->set('le_text', $this->getLoginElemenText());
366  $this->storage->set('le_type', (string) $this->getLoginElementType());
367  $this->storage->set('prompt_type', (string) $this->getLoginPromptType());
368  $this->storage->set('logout_scope', (string) $this->getLogoutScope());
369  $this->storage->set('custom_session', (string) ((int) $this->isCustomSession()));
370  $this->storage->set('session_duration', (string) $this->getSessionDuration());
371  $this->storage->set('allow_sync', (string) ((int) $this->isSyncAllowed()));
372  $this->storage->set('role', (string) $this->getRole());
373  $this->storage->set('uid', $this->getUidField());
374 
375  foreach ($this->getProfileMappingFields() as $field => $lang_key) {
376  $this->storage->set('pmap_' . $field, $this->getProfileMappingFieldValue($field));
377  $this->storage->set('pumap_' . $field, (string) ((int) $this->getProfileMappingFieldUpdate($field)));
378  }
379  $this->storage->set('role_mappings', serialize($this->getRoleMappings()));
380  $this->storage->set('validate_scopes', (string) $this->getValidateScopes());
381  if (self::URL_VALIDATION_CUSTOM === $this->getValidateScopes()) {
382  $this->storage->set('custom_discovery_url', $this->getCustomDiscoveryUrl());
383  } else {
384  $this->storage->delete('custom_discovery_url');
385  }
386  }
+ Here is the call graph for this function:

◆ setActive()

ilOpenIdConnectSettings::setActive ( bool  $active)

Definition at line 94 of file class.ilOpenIdConnectSettings.php.

References $active.

Referenced by load().

94  : void
95  {
96  $this->active = $active;
97  }
+ Here is the caller graph for this function:

◆ setAdditionalScopes()

ilOpenIdConnectSettings::setAdditionalScopes ( array  $additional_scopes)
Parameters
string[]$additional_scopes
Returns
void

Definition at line 247 of file class.ilOpenIdConnectSettings.php.

References $additional_scopes.

Referenced by load().

247  : void
248  {
249  $this->additional_scopes = $additional_scopes;
250  }
+ Here is the caller graph for this function:

◆ setClientId()

ilOpenIdConnectSettings::setClientId ( string  $client_id)

Definition at line 114 of file class.ilOpenIdConnectSettings.php.

References $client_id.

Referenced by load().

114  : void
115  {
116  $this->client_id = $client_id;
117  }
+ Here is the caller graph for this function:

◆ setCustomDiscoveryUrl()

ilOpenIdConnectSettings::setCustomDiscoveryUrl ( ?string  $discoveryUrl)

Definition at line 453 of file class.ilOpenIdConnectSettings.php.

Referenced by load().

453  : void
454  {
455  $this->custom_discovery_url = $discoveryUrl;
456  }
+ Here is the caller graph for this function:

◆ setLoginElementImage()

ilOpenIdConnectSettings::setLoginElementImage ( string  $a_img_name)

Definition at line 144 of file class.ilOpenIdConnectSettings.php.

Referenced by load().

144  : void
145  {
146  $this->login_element_img_name = $a_img_name;
147  }
+ Here is the caller graph for this function:

◆ setLoginElementText()

ilOpenIdConnectSettings::setLoginElementText ( string  $text)

Definition at line 154 of file class.ilOpenIdConnectSettings.php.

Referenced by load().

154  : void
155  {
156  $this->login_element_text = $text;
157  }
+ Here is the caller graph for this function:

◆ setLoginElementType()

ilOpenIdConnectSettings::setLoginElementType ( int  $type)

Definition at line 134 of file class.ilOpenIdConnectSettings.php.

References $type.

Referenced by load().

134  : void
135  {
136  $this->login_element_type = $type;
137  }
$type
+ Here is the caller graph for this function:

◆ setLoginPromptType()

ilOpenIdConnectSettings::setLoginPromptType ( int  $a_type)

Definition at line 165 of file class.ilOpenIdConnectSettings.php.

Referenced by load().

165  : void
166  {
167  $this->login_prompt_type = $a_type;
168  }
+ Here is the caller graph for this function:

◆ setLogoutScope()

ilOpenIdConnectSettings::setLogoutScope ( int  $a_scope)

Definition at line 175 of file class.ilOpenIdConnectSettings.php.

Referenced by load().

175  : void
176  {
177  $this->logout_scope = $a_scope;
178  }
+ Here is the caller graph for this function:

◆ setProfileMappingFieldUpdate()

ilOpenIdConnectSettings::setProfileMappingFieldUpdate ( string  $field,
bool  $value 
)

Definition at line 438 of file class.ilOpenIdConnectSettings.php.

438  : void
439  {
440  $this->profile_update_map[$field] = $value;
441  }

◆ setProfileMappingFieldValue()

ilOpenIdConnectSettings::setProfileMappingFieldValue ( string  $field,
string  $value 
)

Definition at line 428 of file class.ilOpenIdConnectSettings.php.

428  : void
429  {
430  $this->profile_map[$field] = $value;
431  }

◆ setProvider()

ilOpenIdConnectSettings::setProvider ( string  $url)

Definition at line 104 of file class.ilOpenIdConnectSettings.php.

References $url.

Referenced by load().

104  : void
105  {
106  $this->provider = $url;
107  }
$url
+ Here is the caller graph for this function:

◆ setRole()

ilOpenIdConnectSettings::setRole ( int  $role)

Definition at line 215 of file class.ilOpenIdConnectSettings.php.

References $role.

Referenced by load().

215  : void
216  {
217  $this->role = $role;
218  }
+ Here is the caller graph for this function:

◆ setRoleMappings()

ilOpenIdConnectSettings::setRoleMappings ( array  $a_role_mappings)
Parameters
array<int,array{valuestring, update: bool}> $a_role_mappings

Definition at line 295 of file class.ilOpenIdConnectSettings.php.

Referenced by load().

295  : void
296  {
297  $this->role_mappings = $a_role_mappings;
298  }
+ Here is the caller graph for this function:

◆ setSecret()

ilOpenIdConnectSettings::setSecret ( string  $secret)

Definition at line 124 of file class.ilOpenIdConnectSettings.php.

References $secret.

Referenced by load().

124  : void
125  {
126  $this->secret = $secret;
127  }
+ Here is the caller graph for this function:

◆ setSessionDuration()

ilOpenIdConnectSettings::setSessionDuration ( int  $a_duration)

Definition at line 195 of file class.ilOpenIdConnectSettings.php.

Referenced by load().

195  : void
196  {
197  $this->session_duration = $a_duration;
198  }
+ Here is the caller graph for this function:

◆ setUidField()

ilOpenIdConnectSettings::setUidField ( string  $field)

Definition at line 225 of file class.ilOpenIdConnectSettings.php.

Referenced by load().

225  : void
226  {
227  $this->uid = $field;
228  }
+ Here is the caller graph for this function:

◆ setValidateScopes()

ilOpenIdConnectSettings::setValidateScopes ( int  $validation_mode)

Definition at line 443 of file class.ilOpenIdConnectSettings.php.

Referenced by load().

443  : void
444  {
445  $this->validate_scopes = $validation_mode;
446  }
+ Here is the caller graph for this function:

◆ useCustomSession()

ilOpenIdConnectSettings::useCustomSession ( bool  $a_stat)

Definition at line 185 of file class.ilOpenIdConnectSettings.php.

Referenced by load().

185  : void
186  {
187  $this->custom_session = $a_stat;
188  }
+ Here is the caller graph for this function:

◆ validateScopes()

ilOpenIdConnectSettings::validateScopes ( string  $discoveryURL,
array  $custom_scopes 
)

Definition at line 326 of file class.ilOpenIdConnectSettings.php.

References $response.

326  : array
327  {
328  $result = [];
329  try {
330  $curl = new ilCurlConnection($discoveryURL);
331  $curl->init();
332 
333  $curl->setOpt(CURLOPT_HEADER, 0);
334  $curl->setOpt(CURLOPT_RETURNTRANSFER, true);
335  $curl->setOpt(CURLOPT_TIMEOUT, 4);
336 
337  $response = $curl->exec();
338 
339  if ($curl->getInfo(CURLINFO_RESPONSE_CODE) === 200) {
340  $decoded_response = json_decode($response, false, 512, JSON_THROW_ON_ERROR);
341  $available_scopes = $decoded_response->scopes_supported;
342  array_unshift($custom_scopes, self::DEFAULT_SCOPE);
343  if (!empty(array_diff($custom_scopes, $available_scopes))) {
344  $result = [self::VALIDATION_ISSUE_INVALID_SCOPE, array_diff($custom_scopes, $available_scopes)];
345  }
346  } else {
347  $result = [self::VALIDATION_ISSUE_DISCOVERY_ERROR, $response];
348  }
349  } finally {
350  if (isset($curl)) {
351  $curl->close();
352  }
353  }
354  return $result;
355  }
$response

Field Documentation

◆ $active

bool ilOpenIdConnectSettings::$active = false
private

Definition at line 51 of file class.ilOpenIdConnectSettings.php.

Referenced by getActive(), and setActive().

◆ $additional_scopes

array ilOpenIdConnectSettings::$additional_scopes = []
private

◆ $allow_sync

bool ilOpenIdConnectSettings::$allow_sync
private

Definition at line 62 of file class.ilOpenIdConnectSettings.php.

Referenced by isSyncAllowed().

◆ $client_id

string ilOpenIdConnectSettings::$client_id = ''
private

Definition at line 53 of file class.ilOpenIdConnectSettings.php.

Referenced by getClientId(), and setClientId().

◆ $custom_discovery_url

string ilOpenIdConnectSettings::$custom_discovery_url = null
private

Definition at line 74 of file class.ilOpenIdConnectSettings.php.

Referenced by getCustomDiscoveryUrl().

◆ $custom_session

bool ilOpenIdConnectSettings::$custom_session = false
private

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

Referenced by isCustomSession().

◆ $filesystem

Filesystem ilOpenIdConnectSettings::$filesystem
private

Definition at line 50 of file class.ilOpenIdConnectSettings.php.

◆ $instance

self ilOpenIdConnectSettings::$instance = null
staticprivate

Definition at line 47 of file class.ilOpenIdConnectSettings.php.

◆ $login_element_img_name

string ilOpenIdConnectSettings::$login_element_img_name = null
private

Definition at line 56 of file class.ilOpenIdConnectSettings.php.

Referenced by getLoginElementImage().

◆ $login_element_text

string ilOpenIdConnectSettings::$login_element_text = null
private

Definition at line 57 of file class.ilOpenIdConnectSettings.php.

Referenced by getLoginElemenText().

◆ $login_element_type

int ilOpenIdConnectSettings::$login_element_type = self::LOGIN_ELEMENT_TYPE_TXT
private

Definition at line 55 of file class.ilOpenIdConnectSettings.php.

Referenced by getLoginElementType().

◆ $login_prompt_type

int ilOpenIdConnectSettings::$login_prompt_type = self::LOGIN_ENFORCE
private

Definition at line 58 of file class.ilOpenIdConnectSettings.php.

Referenced by getLoginPromptType().

◆ $logout_scope

int ilOpenIdConnectSettings::$logout_scope = null
private

Definition at line 59 of file class.ilOpenIdConnectSettings.php.

Referenced by getLogoutScope().

◆ $profile_map

array ilOpenIdConnectSettings::$profile_map = []
private

Definition at line 66 of file class.ilOpenIdConnectSettings.php.

◆ $profile_update_map

array ilOpenIdConnectSettings::$profile_update_map = []
private

Definition at line 68 of file class.ilOpenIdConnectSettings.php.

◆ $provider

string ilOpenIdConnectSettings::$provider = ''
private

Definition at line 52 of file class.ilOpenIdConnectSettings.php.

Referenced by getProvider().

◆ $role

int ilOpenIdConnectSettings::$role
private

Definition at line 63 of file class.ilOpenIdConnectSettings.php.

Referenced by getRole(), and setRole().

◆ $role_mappings

array ilOpenIdConnectSettings::$role_mappings = []
private

Definition at line 70 of file class.ilOpenIdConnectSettings.php.

Referenced by getRoleMappings().

◆ $secret

string ilOpenIdConnectSettings::$secret = ''
private

Definition at line 54 of file class.ilOpenIdConnectSettings.php.

Referenced by getSecret(), and setSecret().

◆ $session_duration

int ilOpenIdConnectSettings::$session_duration = 60
private

Definition at line 61 of file class.ilOpenIdConnectSettings.php.

Referenced by getSessionDuration().

◆ $storage

ilSetting ilOpenIdConnectSettings::$storage
private

Definition at line 49 of file class.ilOpenIdConnectSettings.php.

◆ $uid

string ilOpenIdConnectSettings::$uid = ''
private

Definition at line 64 of file class.ilOpenIdConnectSettings.php.

Referenced by getUidField().

◆ $validate_scopes

int ilOpenIdConnectSettings::$validate_scopes = self::URL_VALIDATION_PROVIDER
private

Definition at line 73 of file class.ilOpenIdConnectSettings.php.

Referenced by getValidateScopes().

◆ DEFAULT_SCOPE

const ilOpenIdConnectSettings::DEFAULT_SCOPE = 'openid'

◆ FILE_STORAGE

const ilOpenIdConnectSettings::FILE_STORAGE = 'openidconnect/login_form_image'

◆ LOGIN_ELEMENT_TYPE_IMG

const ilOpenIdConnectSettings::LOGIN_ELEMENT_TYPE_IMG = 1

◆ LOGIN_ELEMENT_TYPE_TXT

const ilOpenIdConnectSettings::LOGIN_ELEMENT_TYPE_TXT = 0

◆ LOGIN_ENFORCE

const ilOpenIdConnectSettings::LOGIN_ENFORCE = 0

◆ LOGIN_STANDARD

const ilOpenIdConnectSettings::LOGIN_STANDARD = 1

◆ LOGOUT_SCOPE_GLOBAL

const ilOpenIdConnectSettings::LOGOUT_SCOPE_GLOBAL = 0

◆ LOGOUT_SCOPE_LOCAL

const ilOpenIdConnectSettings::LOGOUT_SCOPE_LOCAL = 1

◆ STORAGE_ID

const ilOpenIdConnectSettings::STORAGE_ID = 'oidc'
private

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

◆ URL_VALIDATION_CUSTOM

const ilOpenIdConnectSettings::URL_VALIDATION_CUSTOM = 1

◆ URL_VALIDATION_NONE

const ilOpenIdConnectSettings::URL_VALIDATION_NONE = 2

◆ URL_VALIDATION_PROVIDER

const ilOpenIdConnectSettings::URL_VALIDATION_PROVIDER = 0

◆ VALIDATION_ISSUE_DISCOVERY_ERROR

const ilOpenIdConnectSettings::VALIDATION_ISSUE_DISCOVERY_ERROR = 1

Definition at line 45 of file class.ilOpenIdConnectSettings.php.

◆ VALIDATION_ISSUE_INVALID_SCOPE

const ilOpenIdConnectSettings::VALIDATION_ISSUE_INVALID_SCOPE = 0

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