ILIAS  release_7 Revision v7.30-3-g800a261c036
ilOpenIdConnectSettings Class Reference

Class ilOpenIdConnectSettingsGUI. More...

+ Collaboration diagram for ilOpenIdConnectSettings:

Public Member Functions

 setActive (bool $active)
 
 getActive ()
 
 setProvider (string $url)
 
 getProvider ()
 
 setClientId (string $client_id)
 
 getClientId ()
 
 setSecret (string $secret)
 
 getSecret ()
 Get secret. More...
 
 setLoginElementType (int $type)
 Set login element type. More...
 
 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 ()
 Delete image file. More...
 
 hasImageFile ()
 
 getImageFilePath ()
 
 setRoleMappings (array $a_role_mappings)
 
 getRoleMappings ()
 Get role mappings. More...
 
 getRoleMappingValueForId ($a_role_id)
 
 getRoleMappingUpdateForId ($a_role_id)
 
 setValidateScopes (int $validation_mode)
 
 getValidateScopes ()
 
 setCustomDiscoveryUrl (?string $discoveryUrl)
 
 getCustomDiscoveryUrl ()
 
 validateScopes (string $discoveryURL, array $custom_scopes)
 
 save ()
 Save in settings. More...
 
 getProfileMappingFieldValue (string $field)
 
 setProfileMappingFieldValue (string $field, string $value)
 
 getProfileMappingFieldUpdate (string $field)
 
 setProfileMappingFieldUpdate (string $field, bool $value)
 
 getProfileMappingFields ()
 

Static Public Member Functions

static getInstance ()
 Get singleton instance. More...
 

Data Fields

const FILE_STORAGE = 'openidconnect/login_form_image'
 
const STORAGE_ID = 'oidc'
 
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 ()
 Load from settings. More...
 

Private Member Functions

 __construct ()
 ilOpenIdConnectSettings constructor. More...
 

Private Attributes

 $storage = null
 
 $filesystem = null
 
 $active = false
 
 $provider = ''
 
 $client_id = ''
 
 $secret = ''
 
 $login_element_type = self::LOGIN_ELEMENT_TYPE_TXT
 
 $login_element_img_name
 
 $login_element_text
 
 $login_prompt_type = self::LOGIN_ENFORCE
 
 $logout_scope
 
 $custom_session = false
 
 $session_duration = 60
 
 $allow_sync
 
 $role
 
 $uid = ''
 
 $profile_map = []
 
 $profile_update_map = []
 
 $role_mappings = []
 
 $additional_scopes = []
 
 $validate_scopes = self::URL_VALIDATION_PROVIDER
 
 $custom_discovery_url = null
 

Static Private Attributes

static $instance = null
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilOpenIdConnectSettings::__construct ( )
private

ilOpenIdConnectSettings constructor.

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

151 {
152 global $DIC;
153
154 $this->storage = new ilSetting(self::STORAGE_ID);
155 $this->filesystem = $DIC->filesystem()->web();
156 $this->load();
157 }
ILIAS Setting Class.
global $DIC
Definition: goto.php:24

References $DIC, and load().

+ Here is the call graph for this function:

Member Function Documentation

◆ allowSync()

ilOpenIdConnectSettings::allowSync ( bool  $a_stat)
Parameters
bool$a_stat

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

354 {
355 $this->allow_sync = $a_stat;
356 }

Referenced by load().

+ Here is the caller graph for this function:

◆ deleteImageFile()

ilOpenIdConnectSettings::deleteImageFile ( )

Delete image file.

Exceptions

ILIAS\Filesystem\Exception\FileNotFoundException

Exceptions

ILIAS\Filesystem\Exception\IOException

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

424 {
425 if ($this->filesystem->has(self::FILE_STORAGE . '/' . $this->getLoginElementImage())) {
426 $this->filesystem->delete(self::FILE_STORAGE . '/' . $this->getLoginElementImage());
427 }
428 }

References getLoginElementImage().

+ Here is the call graph for this function:

◆ getActive()

ilOpenIdConnectSettings::getActive ( )
Returns
bool

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

182 : bool
183 {
184 return $this->active;
185 }

References $active.

Referenced by save().

+ Here is the caller graph for this function:

◆ getAdditionalScopes()

ilOpenIdConnectSettings::getAdditionalScopes ( )
Returns
array

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

393 : array
394 {
396 }

References $additional_scopes.

Referenced by save().

+ Here is the caller graph for this function:

◆ getAllScopes()

ilOpenIdConnectSettings::getAllScopes ( )
Returns
array

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

409 : array
410 {
411 $scopes = $this->additional_scopes;
412 array_unshift($scopes, self::DEFAULT_SCOPE);
413
414 return $scopes;
415 }

References $additional_scopes.

◆ getClientId()

ilOpenIdConnectSettings::getClientId ( )
Returns
string

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

214 : string
215 {
216 return $this->client_id;
217 }

References $client_id.

Referenced by save().

+ Here is the caller graph for this function:

◆ getCustomDiscoveryUrl()

ilOpenIdConnectSettings::getCustomDiscoveryUrl ( )

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

514 : ?string
515 {
517 }

References $custom_discovery_url.

Referenced by save().

+ Here is the caller graph for this function:

◆ getImageFilePath()

ilOpenIdConnectSettings::getImageFilePath ( )
Returns
string

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

443 : string
444 {
445 return implode(
446 '/',
447 [
449 self::FILE_STORAGE . '/' . $this->getLoginElementImage()
450 ]
451 );
452 }
static getWebspaceDir($mode="filesystem")
get webspace directory

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

+ Here is the call graph for this function:

◆ getInstance()

static ilOpenIdConnectSettings::getInstance ( )
static

Get singleton instance.

Returns
\ilOpenIdConnectSettings

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

164 {
165 if (!self::$instance) {
166 self::$instance = new self();
167 }
168 return new self::$instance;
169 }
Class ilOpenIdConnectSettingsGUI.

References $instance.

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

+ Here is the caller graph for this function:

◆ getLoginElemenText()

ilOpenIdConnectSettings::getLoginElemenText ( )

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

273 : string
274 {
276 }

References $login_element_text.

Referenced by save().

+ Here is the caller graph for this function:

◆ getLoginElementImage()

ilOpenIdConnectSettings::getLoginElementImage ( )
Returns
string

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

262 : string
263 {
265 }

References $login_element_img_name.

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

+ Here is the caller graph for this function:

◆ getLoginElementType()

ilOpenIdConnectSettings::getLoginElementType ( )
Returns
int

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

References $login_element_type.

Referenced by save().

+ Here is the caller graph for this function:

◆ getLoginPromptType()

ilOpenIdConnectSettings::getLoginPromptType ( )
Returns
int

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

References $login_prompt_type.

Referenced by save().

+ Here is the caller graph for this function:

◆ getLogoutScope()

ilOpenIdConnectSettings::getLogoutScope ( )
Returns
int

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

305 : int
306 {
307 return $this->logout_scope;
308 }

References $logout_scope.

Referenced by save().

+ Here is the caller graph for this function:

◆ getProfileMappingFields()

ilOpenIdConnectSettings::getProfileMappingFields ( )
Returns
array

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

659 : array
660 {
661 return [
662 'firstname' => 'firstname',
663 'lastname' => 'lastname',
664 'email' => 'email',
665 'birthday' => 'birthday'
666 ];
667 }

Referenced by load(), and save().

+ Here is the caller graph for this function:

◆ getProfileMappingFieldUpdate()

ilOpenIdConnectSettings::getProfileMappingFieldUpdate ( string  $field)
Parameters
string$value
Returns
bool

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

641 : bool
642 {
643 return (bool) $this->profile_update_map[$field];
644 }

Referenced by save().

+ Here is the caller graph for this function:

◆ getProfileMappingFieldValue()

ilOpenIdConnectSettings::getProfileMappingFieldValue ( string  $field)
Parameters
string$field

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

623 : string
624 {
625 return (string) $this->profile_map[$field];
626 }

Referenced by save().

+ Here is the caller graph for this function:

◆ getProvider()

ilOpenIdConnectSettings::getProvider ( )
Returns
string

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

198 : string
199 {
200 return $this->provider;
201 }

References $provider.

Referenced by save().

+ Here is the caller graph for this function:

◆ getRole()

ilOpenIdConnectSettings::getRole ( )
Returns
int

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

369 : int
370 {
371 return $this->role;
372 }

References $role.

Referenced by save().

+ Here is the caller graph for this function:

◆ getRoleMappings()

ilOpenIdConnectSettings::getRoleMappings ( )

Get role mappings.

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

465 : array
466 {
467 return (array) $this->role_mappings;
468 }

References $role_mappings.

Referenced by save().

+ Here is the caller graph for this function:

◆ getRoleMappingUpdateForId()

ilOpenIdConnectSettings::getRoleMappingUpdateForId (   $a_role_id)
Parameters
$a_role_id
Returns
string

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

489 : bool
490 {
491 if (
492 isset($this->role_mappings[$a_role_id]) &&
493 isset($this->role_mappings[$a_role_id]['update'])
494 ) {
495 return (bool) $this->role_mappings[$a_role_id]['update'];
496 }
497 return '';
498 }

◆ getRoleMappingValueForId()

ilOpenIdConnectSettings::getRoleMappingValueForId (   $a_role_id)
Parameters
$a_role_id
Returns
string

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

474 : string
475 {
476 if (
477 isset($this->role_mappings[$a_role_id]) &&
478 isset($this->role_mappings[$a_role_id]['value'])
479 ) {
480 return (string) $this->role_mappings[$a_role_id]['value'];
481 }
482 return '';
483 }

◆ getSecret()

ilOpenIdConnectSettings::getSecret ( )

Get secret.

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

230 : string
231 {
232 return $this->secret;
233 }

References $secret.

Referenced by save().

+ Here is the caller graph for this function:

◆ getSessionDuration()

ilOpenIdConnectSettings::getSessionDuration ( )
Returns
int

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

References $session_duration.

Referenced by save().

+ Here is the caller graph for this function:

◆ getUidField()

ilOpenIdConnectSettings::getUidField ( )
Returns
string

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

385 : string
386 {
387 return $this->uid;
388 }

References $uid.

Referenced by save().

+ Here is the caller graph for this function:

◆ getValidateScopes()

ilOpenIdConnectSettings::getValidateScopes ( )

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

References $validate_scopes.

Referenced by load(), and save().

+ Here is the caller graph for this function:

◆ hasImageFile()

ilOpenIdConnectSettings::hasImageFile ( )
Returns
bool

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

433 : bool
434 {
435 return
436 strlen($this->getLoginElementImage()) &&
437 $this->filesystem->has(self::FILE_STORAGE . '/' . $this->getLoginElementImage());
438 }

References getLoginElementImage().

+ Here is the call graph for this function:

◆ isCustomSession()

ilOpenIdConnectSettings::isCustomSession ( )
Returns
bool

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

321 : bool
322 {
324 }

References $custom_session.

Referenced by save().

+ Here is the caller graph for this function:

◆ isSyncAllowed()

ilOpenIdConnectSettings::isSyncAllowed ( )
Returns
bool

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

345 : bool
346 {
347 return $this->allow_sync;
348 }

References $allow_sync.

Referenced by save().

+ Here is the caller graph for this function:

◆ load()

ilOpenIdConnectSettings::load ( )
protected

Load from settings.

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

592 {
593 foreach ($this->getProfileMappingFields() as $field => $lang_key) {
594 $this->profile_map[$field] = (string) $this->storage->get('pmap_' . $field, '');
595 $this->profile_update_map[$field] = (bool) $this->storage->get('pumap_' . $field, '');
596 }
597
598 $this->setActive((bool) $this->storage->get('active', 0));
599 $this->setProvider($this->storage->get('provider', ''));
600 $this->setClientId($this->storage->get('client_id', ''));
601 $this->setSecret($this->storage->get('secret', ''));
602 $this->setAdditionalScopes((array) unserialize($this->storage->get('scopes', serialize([]))));
603 $this->setLoginElementImage($this->storage->get('le_img', ''));
604 $this->setLoginElementText($this->storage->get('le_text'));
605 $this->setLoginElementType($this->storage->get('le_type'));
606 $this->setLoginPromptType((int) $this->storage->get('prompt_type', self::LOGIN_ENFORCE));
607 $this->setLogoutScope((int) $this->storage->get('logout_scope', self::LOGOUT_SCOPE_GLOBAL));
608 $this->useCustomSession((bool) $this->storage->get('custom_session'), false);
609 $this->setSessionDuration((int) $this->storage->get('session_duration', 60));
610 $this->allowSync((bool) $this->storage->get('allow_sync'), false);
611 $this->setRole((int) $this->storage->get('role'), 0);
612 $this->setUidField((string) $this->storage->get('uid'), '');
613 $this->setRoleMappings((array) unserialize($this->storage->get('role_mappings', serialize([]))));
614 $this->setValidateScopes((int) $this->storage->get('validate_scopes', (string) self::URL_VALIDATION_PROVIDER));
615 if (self::URL_VALIDATION_CUSTOM === $this->getValidateScopes()) {
616 $this->setCustomDiscoveryUrl($this->storage->get('custom_discovery_url'));
617 }
618 }
setAdditionalScopes(array $additional_scopes)
setLoginElementType(int $type)
Set login element type.
setCustomDiscoveryUrl(?string $discoveryUrl)
setRoleMappings(array $a_role_mappings)

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().

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

◆ save()

ilOpenIdConnectSettings::save ( )

Save in settings.

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

557 {
558 $this->storage->set('active', (int) $this->getActive());
559 $this->storage->set('provider', $this->getProvider());
560 $this->storage->set('client_id', $this->getClientId());
561 $this->storage->set('secret', $this->getSecret());
562 $this->storage->set('scopes', (string) serialize($this->getAdditionalScopes()));
563 $this->storage->set('le_img', $this->getLoginElementImage());
564 $this->storage->set('le_text', $this->getLoginElemenText());
565 $this->storage->set('le_type', $this->getLoginElementType());
566 $this->storage->set('prompt_type', $this->getLoginPromptType());
567 $this->storage->set('logout_scope', $this->getLogoutScope());
568 $this->storage->set('custom_session', (int) $this->isCustomSession());
569 $this->storage->set('session_duration', (int) $this->getSessionDuration());
570 $this->storage->set('allow_sync', (int) $this->isSyncAllowed());
571 $this->storage->set('role', (int) $this->getRole());
572 $this->storage->set('uid', (string) $this->getUidField());
573
574 foreach ($this->getProfileMappingFields() as $field => $lang_key) {
575 $this->storage->set('pmap_' . $field, $this->getProfileMappingFieldValue($field));
576 $this->storage->set('pumap_' . $field, $this->getProfileMappingFieldUpdate($field));
577 }
578 $this->storage->set('role_mappings', (string) serialize($this->getRoleMappings()));
579
580 $this->storage->set('validate_scopes', (string) $this->getValidateScopes());
581 if (self::URL_VALIDATION_CUSTOM === $this->getValidateScopes()) {
582 $this->storage->set('custom_discovery_url', $this->getCustomDiscoveryUrl());
583 } else {
584 $this->storage->delete('custom_discovery_url');
585 }
586 }

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

+ Here is the call graph for this function:

◆ setActive()

ilOpenIdConnectSettings::setActive ( bool  $active)
Parameters
bool$active

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

175 {
176 $this->active = $active;
177 }

References $active.

Referenced by load().

+ Here is the caller graph for this function:

◆ setAdditionalScopes()

ilOpenIdConnectSettings::setAdditionalScopes ( array  $additional_scopes)
Parameters
array$additional_scopes

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

402 {
403 $this->additional_scopes = $additional_scopes;
404 }

References $additional_scopes.

Referenced by load().

+ Here is the caller graph for this function:

◆ setClientId()

ilOpenIdConnectSettings::setClientId ( string  $client_id)
Parameters
string$client_id

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

207 {
208 $this->client_id = $client_id;
209 }

References $client_id.

Referenced by load().

+ Here is the caller graph for this function:

◆ setCustomDiscoveryUrl()

ilOpenIdConnectSettings::setCustomDiscoveryUrl ( ?string  $discoveryUrl)

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

509 : void
510 {
511 $this->custom_discovery_url = $discoveryUrl;
512 }

Referenced by load().

+ Here is the caller graph for this function:

◆ setLoginElementImage()

ilOpenIdConnectSettings::setLoginElementImage ( string  $a_img_name)
Parameters
string$a_img_name

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

255 {
256 $this->login_element_img_name = $a_img_name;
257 }

Referenced by load().

+ Here is the caller graph for this function:

◆ setLoginElementText()

ilOpenIdConnectSettings::setLoginElementText ( string  $text)

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

268 {
269 $this->login_element_text = $text;
270 }

Referenced by load().

+ Here is the caller graph for this function:

◆ setLoginElementType()

ilOpenIdConnectSettings::setLoginElementType ( int  $type)

Set login element type.

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

239 {
240 $this->login_element_type = $type;
241 }
$type

References $type.

Referenced by load().

+ Here is the caller graph for this function:

◆ setLoginPromptType()

ilOpenIdConnectSettings::setLoginPromptType ( int  $a_type)
Parameters
int$a_type

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

282 {
283 $this->login_prompt_type = $a_type;
284 }

Referenced by load().

+ Here is the caller graph for this function:

◆ setLogoutScope()

ilOpenIdConnectSettings::setLogoutScope ( int  $a_scope)
Parameters
int$a_scope

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

298 {
299 $this->logout_scope = $a_scope;
300 }

Referenced by load().

+ Here is the caller graph for this function:

◆ setProfileMappingFieldUpdate()

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

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

651 {
652 $this->profile_update_map[$field] = $value;
653 }

◆ setProfileMappingFieldValue()

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

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

633 {
634 $this->profile_map[$field] = $value;
635 }

◆ setProvider()

ilOpenIdConnectSettings::setProvider ( string  $url)
Parameters
string$url

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

191 {
192 $this->provider = $url;
193 }
$url

References $url.

Referenced by load().

+ Here is the caller graph for this function:

◆ setRole()

ilOpenIdConnectSettings::setRole ( int  $role)
Parameters
int$role

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

362 {
363 $this->role = $role;
364 }

References $role.

Referenced by load().

+ Here is the caller graph for this function:

◆ setRoleMappings()

ilOpenIdConnectSettings::setRoleMappings ( array  $a_role_mappings)
Parameters
array$a_role_mappings

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

458 {
459 $this->role_mappings = $a_role_mappings;
460 }

Referenced by load().

+ Here is the caller graph for this function:

◆ setSecret()

ilOpenIdConnectSettings::setSecret ( string  $secret)
Parameters
string$secret

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

223 {
224 $this->secret = $secret;
225 }

References $secret.

Referenced by load().

+ Here is the caller graph for this function:

◆ setSessionDuration()

ilOpenIdConnectSettings::setSessionDuration ( int  $a_duration)
Parameters
int$a_duration

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

330 {
331 $this->session_duration = $a_duration;
332 }

Referenced by load().

+ Here is the caller graph for this function:

◆ setUidField()

ilOpenIdConnectSettings::setUidField ( string  $field)
Parameters
string$field

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

378 {
379 $this->uid = $field;
380 }

Referenced by load().

+ Here is the caller graph for this function:

◆ setValidateScopes()

ilOpenIdConnectSettings::setValidateScopes ( int  $validation_mode)

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

499 : void
500 {
501 $this->validate_scopes = $validation_mode;
502 }

Referenced by load().

+ Here is the caller graph for this function:

◆ useCustomSession()

ilOpenIdConnectSettings::useCustomSession ( bool  $a_stat)
Parameters
bool$a_stat

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

314 {
315 $this->custom_session = $a_stat;
316 }

Referenced by load().

+ Here is the caller graph for this function:

◆ validateScopes()

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

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

520 {
521 $result = array();
522 try {
523 $curl = new ilCurlConnection($discoveryURL);
524 $curl->init();
525
526 $curl->setOpt(CURLOPT_HEADER, 0);
527 $curl->setOpt(CURLOPT_RETURNTRANSFER, true);
528 $curl->setOpt(CURLOPT_TIMEOUT, 4);
529
530 $response = $curl->exec();
531
532 if ($curl->getInfo(CURLINFO_RESPONSE_CODE) === 200) {
533 $available_scopes = $response->scopes_supported;
534 $decoded_response = json_decode($response, false, 512, JSON_THROW_ON_ERROR);
535 $available_scopes = $decoded_response->scopes_supported;
536 array_unshift($custom_scopes, self::DEFAULT_SCOPE);
537
538 $result = array_diff($custom_scopes, $available_scopes);
539 if (!empty(array_diff($custom_scopes, $available_scopes))) {
540 $result = [self::VALIDATION_ISSUE_INVALID_SCOPE, array_diff($custom_scopes, $available_scopes)];
541 }
542 } else {
544 }
545 } catch (ilCurlConnectionException $e) {
546 throw $e;
547 } finally {
548 $curl->close();
549 }
550 return $result;
551 }
$result
$response

References Vendor\Package\$e, $response, $result, VALIDATION_ISSUE_DISCOVERY_ERROR, and VALIDATION_ISSUE_INVALID_SCOPE.

Field Documentation

◆ $active

ilOpenIdConnectSettings::$active = false
private

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

Referenced by getActive(), and setActive().

◆ $additional_scopes

ilOpenIdConnectSettings::$additional_scopes = []
private

◆ $allow_sync

ilOpenIdConnectSettings::$allow_sync
private

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

Referenced by isSyncAllowed().

◆ $client_id

ilOpenIdConnectSettings::$client_id = ''
private

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

Referenced by getClientId(), and setClientId().

◆ $custom_discovery_url

ilOpenIdConnectSettings::$custom_discovery_url = null
private

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

Referenced by getCustomDiscoveryUrl().

◆ $custom_session

ilOpenIdConnectSettings::$custom_session = false
private

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

Referenced by isCustomSession().

◆ $filesystem

ilOpenIdConnectSettings::$filesystem = null
private

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

◆ $instance

ilOpenIdConnectSettings::$instance = null
staticprivate

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

Referenced by getInstance().

◆ $login_element_img_name

ilOpenIdConnectSettings::$login_element_img_name
private

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

Referenced by getLoginElementImage().

◆ $login_element_text

ilOpenIdConnectSettings::$login_element_text
private

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

Referenced by getLoginElemenText().

◆ $login_element_type

ilOpenIdConnectSettings::$login_element_type = self::LOGIN_ELEMENT_TYPE_TXT
private

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

Referenced by getLoginElementType().

◆ $login_prompt_type

ilOpenIdConnectSettings::$login_prompt_type = self::LOGIN_ENFORCE
private

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

Referenced by getLoginPromptType().

◆ $logout_scope

ilOpenIdConnectSettings::$logout_scope
private

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

Referenced by getLogoutScope().

◆ $profile_map

ilOpenIdConnectSettings::$profile_map = []
private

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

◆ $profile_update_map

ilOpenIdConnectSettings::$profile_update_map = []
private

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

◆ $provider

ilOpenIdConnectSettings::$provider = ''
private

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

Referenced by getProvider().

◆ $role

ilOpenIdConnectSettings::$role
private

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

Referenced by getRole(), and setRole().

◆ $role_mappings

ilOpenIdConnectSettings::$role_mappings = []
private

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

Referenced by getRoleMappings().

◆ $secret

ilOpenIdConnectSettings::$secret = ''
private

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

Referenced by getSecret(), and setSecret().

◆ $session_duration

ilOpenIdConnectSettings::$session_duration = 60
private

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

Referenced by getSessionDuration().

◆ $storage

ilOpenIdConnectSettings::$storage = null
private

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

◆ $uid

ilOpenIdConnectSettings::$uid = ''
private

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

Referenced by getUidField().

◆ $validate_scopes

ilOpenIdConnectSettings::$validate_scopes = self::URL_VALIDATION_PROVIDER
private

Definition at line 143 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'

Definition at line 14 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 31 of file class.ilOpenIdConnectSettings.php.

Referenced by validateScopes().

◆ VALIDATION_ISSUE_INVALID_SCOPE

const ilOpenIdConnectSettings::VALIDATION_ISSUE_INVALID_SCOPE = 0

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