ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilOpenIdConnectSettingsGUI Class Reference
+ Collaboration diagram for ilOpenIdConnectSettingsGUI:

Public Member Functions

 __construct (int $a_ref_id)
 
 executeCommand ()
 

Private Member Functions

 checkAccess (string $a_permission)
 
 checkAccessBool (string $a_permission)
 
 settings (?ilPropertyFormGUI $form=null)
 
 initSettingsForm ()
 
 saveSettings ()
 
 saveImageFromHttpRequest ()
 
 prepareRoleSelection (bool $a_with_select_option=true)
 
 profile ()
 
 scopes ()
 
 discoverScopesFromServer ()
 
 buildScopeSelection (array $ui_container)
 
 saveScopes ()
 
 validateDiscoveryUrl (int $type, ?string $url, array $scopes)
 
 saveProfileMapping ()
 
 updateProfileMappingFieldValue (string $field)
 
 roles (?ilPropertyFormGUI $form=null)
 
 initRolesForm ()
 
 saveRoles ()
 
 setSubTabs (string $active_tab)
 
 chooseMapping ()
 
 showInfoMessage ()
 
 initAttributeMapping ()
 
 buildUserMappingInputFormUDF ($definition, array $ui_container)
 
 buildUserMappingInputForUserData (string $lang, string $mapping, array $ui_container)
 
 initUserDefinedFields ()
 
 userMapping ()
 
 redirectToSettingsScreenIfNoURLIsConfigured ()
 
 saniziteArrayElementsTrafo ()
 
 trimIfStringTrafo ()
 

Private Attributes

const STAB_SETTINGS = 'settings'
 
const STAB_SCOPES = 'scopes'
 
const STAB_PROFILE = 'profile'
 
const STAB_ROLES = 'roles'
 
const VALUE_STRING = '_value'
 
const UPDATE_STRING = '_update'
 
const UDF_STRING = 'udf_'
 
const DEFAULT_CMD = 'settings'
 
const DEFAULT_VALUES = 1
 
const SAVED_VALUES = 2
 
const POST_VALUE = 'Mode'
 
const VIEW_TAB_PRE_FILED = 1
 
const VIEW_TAB_EFFECTIVE_MAPPING = 2
 
const URL_VALIDATION_PROVIDER_STRING = '/.well-known/openid-configuration'
 
const EFFECTIVE_ATTRIBUTE_MAPPING_TAB = 2
 
int $ref_id
 
 $body
 
readonly ilOpenIdConnectSettings $settings
 
readonly ilLanguage $lng
 
readonly ilCtrl $ctrl
 
readonly ilLogger $logger
 
readonly ilAccessHandler $access
 
readonly ilRbacReview $review
 
readonly ilErrorHandling $error
 
readonly ilGlobalTemplateInterface $mainTemplate
 
readonly ilTabsGUI $tabs
 
readonly FileUpload $upload
 
readonly Profile $profile
 
ilToolbarGUI $toolbar
 
array $user_defined_fields = null
 
ilGlobalTemplateInterface $tpl
 
int $mapping_template = self::VIEW_TAB_EFFECTIVE_MAPPING
 
ServerRequestInterface $request
 
ilOpenIdAttributeMappingTemplate $attribute_mapping_template
 
Factory $ui
 
Renderer $renderer
 
Services $http
 
Factory $factory
 
ILIAS Refinery Factory $refinery
 
string $failed_validation_messages = ''
 

Detailed Description

Definition at line 30 of file class.ilOpenIdConnectSettingsGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilOpenIdConnectSettingsGUI::__construct ( int  $a_ref_id)

Definition at line 78 of file class.ilOpenIdConnectSettingsGUI.php.

79 {
80 global $DIC;
81
82 $this->ref_id = $a_ref_id;
83
84 $this->lng = $DIC->language();
85 $this->lng->loadLanguageModule('auth');
86
87 $this->mainTemplate = $DIC->ui()->mainTemplate();
88 $this->tabs = $DIC->tabs();
89 $this->ctrl = $DIC->ctrl();
90 $this->logger = $DIC->logger()->auth();
91 $this->access = $DIC->access();
92 $this->review = $DIC->rbac()->review();
93 $this->error = $DIC['ilErr'];
94 $this->upload = $DIC->upload();
95 $this->body = $DIC->http()->request()->getParsedBody();
97 $http_wrapper = $DIC->http()->wrapper();
98 $this->toolbar = $DIC->toolbar();
99 $refinery = $DIC->refinery();
100 $this->tpl = $DIC->ui()->mainTemplate();
101 $this->http = $DIC->http();
102 $this->ui = $DIC->ui()->factory();
103 $this->renderer = $DIC->ui()->renderer();
104 $this->refinery = $DIC->refinery();
105 $this->factory = $DIC->ui()->factory();
106 $this->request = $DIC->http()->request();
107 $this->profile = $DIC['user']->getProfile();
108 $this->attribute_mapping_template = new ilOpenIdAttributeMappingTemplate();
109
110 if ($http_wrapper->query()->has(self::POST_VALUE) && $http_wrapper->query()->retrieve(
111 self::POST_VALUE,
112 $refinery->kindlyTo()->int()
113 )) {
114 $this->mapping_template = $http_wrapper->query()->retrieve(self::POST_VALUE, $refinery->kindlyTo()->int());
115 }
116 }
mainTemplate()
renderer()
factory()
error(string $a_errmsg)
settings(?ilPropertyFormGUI $form=null)
static http()
Fetches the global http state from ILIAS.
global $DIC
Definition: shib_login.php:26

References $DIC, $refinery, ILIAS\Repository\access(), ILIAS\Repository\ctrl(), error(), factory(), ilOpenIdConnectSettings\getInstance(), ILIAS\FileDelivery\http(), ILIAS\Repository\lng(), ILIAS\Repository\logger(), mainTemplate(), profile(), ILIAS\Repository\refinery(), renderer(), settings(), ILIAS\Repository\tabs(), ILIAS\Repository\toolbar(), ILIAS\Repository\ui(), and ILIAS\Repository\upload().

+ Here is the call graph for this function:

Member Function Documentation

◆ buildScopeSelection()

ilOpenIdConnectSettingsGUI::buildScopeSelection ( array  $ui_container)
private
Parameters
list<FormInput>$ui_container
Returns
list<FormInput>

Definition at line 496 of file class.ilOpenIdConnectSettingsGUI.php.

496 : array
497 {
498 $disabled_input = $this->ui
499 ->input()
500 ->field()
501 ->text($this->lng->txt('auth_oidc_settings_default_scopes'), '')
502 ->withAdditionalTransformation($this->trimIfStringTrafo())
504 ->withDedicatedName('default_scope')
505 ->withDisabled(true);
506
507 $scopeValues = $this->settings->getAdditionalScopes();
508
509 $tag_input = $this->ui
510 ->input()
511 ->field()
512 ->tag(
513 $this->lng->txt('auth_oidc_settings_additional_scopes'),
514 $scopeValues
515 )->withValue($scopeValues)
516 ->withDedicatedName('custom_scope')
517 ->withByline($this->lng->txt('auth_oidc_settings_additional_scopes_info'));
518 $group1 = $this->ui->input()->field()->group(
519 [],
520 $this->lng->txt('auth_oidc_settings_validate_scope_default')
521 );
522 $group2 = $this->ui->input()->field()->group(
523 [
524 $this->lng->txt('auth_oidc_settings_discovery_url') => $this->ui
525 ->input()
526 ->field()
527 ->text(
528 $this->lng->txt('auth_oidc_settings_discovery_url')
529 )
530 ->withAdditionalTransformation($this->trimIfStringTrafo())
531 ->withValue(
532 $this->settings->getCustomDiscoveryUrl() ?? ''
533 )
534 ],
535 $this->lng->txt('auth_oidc_settings_validate_scope_custom')
536 );
537 $group3 = $this->ui->input()->field()->group(
538 [],
539 $this->lng->txt('auth_oidc_settings_validate_scope_none')
540 );
541 $url_validation = $this->ui->input()->field()->switchableGroup(
542 [
546 ],
547 $this->lng->txt('auth_oidc_settings_validate_scopes')
548 )->withDedicatedName('validate_scopes')->withValue($this->settings->getValidateScopes());
549 $group = $this->ui->input()->field()->group(
550 [$disabled_input, $tag_input, $url_validation]
551 );
552 $ui_container[] = $group;
553
554 return $ui_container;
555 }

References ilOpenIdConnectSettings\DEFAULT_SCOPE, ILIAS\Repository\lng(), settings(), trimIfStringTrafo(), ILIAS\Repository\ui(), ilOpenIdConnectSettings\URL_VALIDATION_CUSTOM, ilOpenIdConnectSettings\URL_VALIDATION_NONE, and ilOpenIdConnectSettings\URL_VALIDATION_PROVIDER.

+ Here is the call graph for this function:

◆ buildUserMappingInputFormUDF()

ilOpenIdConnectSettingsGUI::buildUserMappingInputFormUDF (   $definition,
array  $ui_container 
)
private
Parameters
array{"field_id"int, "field_name": string} $definition
list<FormInput>$ui_container
Returns
list<FormInput>

Definition at line 953 of file class.ilOpenIdConnectSettingsGUI.php.

953 : array
954 {
955 $value = $this->settings->getProfileMappingFieldValue(self::UDF_STRING . $definition->getIdentifier());
956 $update = $this->settings->getProfileMappingFieldUpdate(self::UDF_STRING . $definition->getIdentifier());
957
958 $text_input = $this->ui
959 ->input()
960 ->field()
961 ->text($definition->getLabel(), '')
962 ->withAdditionalTransformation($this->trimIfStringTrafo())
963 ->withValue($value)
964 ->withDedicatedName(self::UDF_STRING . $definition->getIdentifier() . self::VALUE_STRING);
965 $checkbox_input = $this->ui
966 ->input()
967 ->field()->checkbox('', $this->lng->txt('auth_oidc_update_field_info'))
968 ->withValue($update)
969 ->withDedicatedName(
970 self::UDF_STRING . $definition->getIdentifier() . self::UPDATE_STRING
971 );
972 $group = $this->ui->input()->field()->group(
973 [$text_input, $checkbox_input]
974 );
975 $ui_container[] = $group;
976
977 return $ui_container;
978 }

References ILIAS\Repository\lng(), settings(), trimIfStringTrafo(), and ILIAS\Repository\ui().

+ Here is the call graph for this function:

◆ buildUserMappingInputForUserData()

ilOpenIdConnectSettingsGUI::buildUserMappingInputForUserData ( string  $lang,
string  $mapping,
array  $ui_container 
)
private
Parameters
list<FormInput>$ui_container
Returns
list<FormInput>

Definition at line 984 of file class.ilOpenIdConnectSettingsGUI.php.

984 : array
985 {
986 $value = $this->settings->getProfileMappingFieldValue($mapping);
987 $update = $this->settings->getProfileMappingFieldUpdate($mapping);
988
989 $text_input = $this->ui
990 ->input()
991 ->field()
992 ->text($lang, '')
993 ->withAdditionalTransformation($this->trimIfStringTrafo())
994 ->withValue($value)
995 ->withDedicatedName($mapping . self::VALUE_STRING);
996 $checkbox_input = $this->ui
997 ->input()
998 ->field()
999 ->checkbox('', $this->lng->txt('auth_oidc_update_field_info'))
1000 ->withValue($update)
1001 ->withDedicatedName($mapping . self::UPDATE_STRING);
1002 $group = $this->ui->input()->field()->group(
1003 [
1004 $text_input,
1005 $checkbox_input
1006 ]
1007 );
1008 $ui_container[] = $group;
1009
1010 return $ui_container;
1011 }
$lang
Definition: xapiexit.php:25

References ILIAS\Repository\lng(), settings(), trimIfStringTrafo(), and ILIAS\Repository\ui().

+ Here is the call graph for this function:

◆ checkAccess()

ilOpenIdConnectSettingsGUI::checkAccess ( string  $a_permission)
private

Definition at line 118 of file class.ilOpenIdConnectSettingsGUI.php.

118 : void
119 {
120 if (!$this->checkAccessBool($a_permission)) {
121 $this->error->raiseError($this->lng->txt('msg_no_perm_read'), $this->error->WARNING);
122 }
123 }

References checkAccessBool(), error(), and ILIAS\Repository\lng().

Referenced by executeCommand(), profile(), roles(), saveRoles(), saveScopes(), saveSettings(), scopes(), and settings().

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

◆ checkAccessBool()

ilOpenIdConnectSettingsGUI::checkAccessBool ( string  $a_permission)
private

Definition at line 125 of file class.ilOpenIdConnectSettingsGUI.php.

125 : bool
126 {
127 return $this->access->checkAccess($a_permission, '', $this->ref_id);
128 }

References ILIAS\Repository\access().

Referenced by checkAccess(), initRolesForm(), initSettingsForm(), and saveProfileMapping().

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

◆ chooseMapping()

ilOpenIdConnectSettingsGUI::chooseMapping ( )
private

Definition at line 858 of file class.ilOpenIdConnectSettingsGUI.php.

858 : void
859 {
860 $this->showInfoMessage();
861
862 $this->setSubTabs(self::STAB_PROFILE);
863
864 if ((int) $this->mapping_template === self::VIEW_TAB_EFFECTIVE_MAPPING) {
865 $this->userMapping();
866 return;
867 }
868
869 $this->initAttributeMapping();
870 }

References initAttributeMapping(), setSubTabs(), showInfoMessage(), and userMapping().

Referenced by profile().

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

◆ discoverScopesFromServer()

ilOpenIdConnectSettingsGUI::discoverScopesFromServer ( )
private

Definition at line 472 of file class.ilOpenIdConnectSettingsGUI.php.

472 : void
473 {
474 $url = '';
475 $type = $this->settings->getValidateScopes();
477 $url = $this->settings->getProvider() . self::URL_VALIDATION_PROVIDER_STRING;
479 $url = $this->settings->getCustomDiscoveryUrl();
480 }
481
482 if ($url !== '') {
483 $found_scopes = $this->settings->getSupportedScopesFromUrl($url);
484 if ($found_scopes === true) {
485 $this->mainTemplate->setOnScreenMessage('success', $this->lng->txt('auth_oidc_discover_scopes_info'));
486 }
487 }
488
489 $this->scopes();
490 }
$url
Definition: shib_logout.php:68

References $url, ILIAS\Repository\lng(), mainTemplate(), scopes(), settings(), ilOpenIdConnectSettings\URL_VALIDATION_CUSTOM, ilOpenIdConnectSettings\URL_VALIDATION_PROVIDER, and URL_VALIDATION_PROVIDER_STRING.

+ Here is the call graph for this function:

◆ executeCommand()

ilOpenIdConnectSettingsGUI::executeCommand ( )

Definition at line 130 of file class.ilOpenIdConnectSettingsGUI.php.

130 : void
131 {
132 $this->checkAccess('read');
133
134 switch ($this->ctrl->getNextClass()) {
135 default:
136 $cmd = $this->ctrl->getCmd(self::DEFAULT_CMD);
137 $this->$cmd();
138 break;
139 }
140 }

References checkAccess(), and ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ initAttributeMapping()

ilOpenIdConnectSettingsGUI::initAttributeMapping ( )
private

Definition at line 896 of file class.ilOpenIdConnectSettingsGUI.php.

896 : void
897 {
898 $mapping = $this->attribute_mapping_template->getMappingRulesByAdditionalScopes(
899 $this->settings->getAdditionalScopes()
900 );
901
902 if (count($mapping) > 0) {
903 $this->settings->clearProfileMaps();
904 }
905
906 foreach ($mapping as $field => $item) {
907 $this->settings->setProfileMappingFieldValue(
908 $field,
909 $item
910 );
911 }
912
913 $this->userMapping();
914 }

References settings(), and userMapping().

Referenced by chooseMapping().

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

◆ initRolesForm()

ilOpenIdConnectSettingsGUI::initRolesForm ( )
private

Definition at line 743 of file class.ilOpenIdConnectSettingsGUI.php.

744 {
745 $form = new ilPropertyFormGUI();
746 $form->setTitle($this->lng->txt('auth_oidc_role_mapping_table'));
747 $form->setFormAction($this->ctrl->getFormAction($this, self::STAB_ROLES));
748
749 foreach ($this->prepareRoleSelection(false) as $role_id => $role_title) {
750 $role_map = new ilTextInputGUI(
751 $role_title,
752 'role_map_' . $role_id
753 );
754 $role_map->setInfo($this->lng->txt('auth_oidc_role_info'));
755 $role_map->setValue($this->settings->getRoleMappingValueForId((int) $role_id));
756 $form->addItem($role_map);
757
758 $update = new ilCheckboxInputGUI(
759 '',
760 'role_map_update_' . $role_id
761 );
762 $update->setOptionTitle($this->lng->txt('auth_oidc_update_role_info'));
763 $update->setValue('1');
764 $update->setChecked(!$this->settings->getRoleMappingUpdateForId((int) $role_id));
765 $form->addItem($update);
766 }
767
768 if ($this->checkAccessBool('write')) {
769 $form->addCommandButton('saveRoles', $this->lng->txt('save'));
770 }
771
772 return $form;
773 }
This class represents a checkbox property in a property form.
prepareRoleSelection(bool $a_with_select_option=true)
This class represents a property form user interface.
This class represents a text property in a property form.

References checkAccessBool(), ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), prepareRoleSelection(), and settings().

Referenced by roles(), and saveRoles().

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

◆ initSettingsForm()

ilOpenIdConnectSettingsGUI::initSettingsForm ( )
private

Definition at line 155 of file class.ilOpenIdConnectSettingsGUI.php.

156 {
157 $form = new ilPropertyFormGUI();
158 $form->setTitle($this->lng->txt('auth_oidc_settings_title'));
159 $form->setFormAction($this->ctrl->getFormAction($this));
160
161 $activation = new ilCheckboxInputGUI(
162 $this->lng->txt('auth_oidc_settings_activation'),
163 'activation'
164 );
165 $activation->setChecked($this->settings->getActive());
166 $form->addItem($activation);
167
169 $this->lng->txt('auth_oidc_settings_provider'),
170 'provider'
171 );
172 $provider->setRequired(true);
173 $provider->setValue($this->settings->getProvider());
174 $form->addItem($provider);
175
177 $this->lng->txt('auth_oidc_settings_client_id'),
178 'client_id'
179 );
180 $client_id->setRequired(true);
181 $client_id->setValue($this->settings->getClientId());
182 $form->addItem($client_id);
183
184 $secret = new ilPasswordInputGUI(
185 $this->lng->txt('auth_oidc_settings_secret'),
186 'secret'
187 );
188 $secret->setSkipSyntaxCheck(true);
189 $secret->setRetype(false);
190 $secret->setRequired(false);
191 if ($this->settings->getSecret() !== '') {
192 $secret->setValue('******');
193 }
194 $form->addItem($secret);
195
196 $login_element = new ilRadioGroupInputGUI(
197 $this->lng->txt('auth_oidc_settings_le'),
198 'le'
199 );
200 $login_element->setRequired(true);
201 $login_element->setValue((string) $this->settings->getLoginElementType());
202 $form->addItem($login_element);
203
204 $text_option = new ilRadioOption(
205 $this->lng->txt('auth_oidc_settings_txt'),
207 );
208 $login_element->addOption($text_option);
209
210 $text = new ilTextInputGUI(
211 '',
212 'le_text'
213 );
214 $text->setValue($this->settings->getLoginElemenText());
215 $text->setMaxLength(120);
216 $text->setInfo($this->lng->txt('auth_oidc_settings_txt_val_info'));
217 $text_option->addSubItem($text);
218
219 $img_option = new ilRadioOption(
220 $this->lng->txt('auth_oidc_settings_img'),
222 );
223 $login_element->addOption($img_option);
224
225 $image = new ilImageFileInputGUI(
226 '',
227 'le_img'
228 );
229 $image->setAllowDeletion(false);
230
231 if ($this->settings->hasImageFile()) {
232 $image->setImage($this->settings->getImageFilePath());
233 }
234 $image->setInfo($this->lng->txt('auth_oidc_settings_img_file_info'));
235 $img_option->addSubItem($image);
236
237 $login_options = new ilRadioGroupInputGUI(
238 $this->lng->txt('auth_oidc_settings_login_options'),
239 'login_prompt'
240 );
241 $login_options->setValue((string) $this->settings->getLoginPromptType());
242
243 $enforce = new ilRadioOption(
244 $this->lng->txt('auth_oidc_settings_login_option_enforce'),
246 );
247 $enforce->setInfo($this->lng->txt('auth_oidc_settings_login_option_enforce_info'));
248 $login_options->addOption($enforce);
249
250 $default = new ilRadioOption(
251 $this->lng->txt('auth_oidc_settings_login_option_default'),
253 );
254 $default->setInfo($this->lng->txt('auth_oidc_settings_login_option_default_info'));
255 $login_options->addOption($default);
256
257 $form->addItem($login_options);
258
259 $logout_scope = new ilRadioGroupInputGUI(
260 $this->lng->txt('auth_oidc_settings_logout_scope'),
261 'logout_scope'
262 );
263 $logout_scope->setValue((string) $this->settings->getLogoutScope());
264
265 $global_scope = new ilRadioOption(
266 $this->lng->txt('auth_oidc_settings_logout_scope_global'),
268 );
269 $global_scope->setInfo($this->lng->txt('auth_oidc_settings_logout_scope_global_info'));
270 $logout_scope->addOption($global_scope);
271
272 $ilias_scope = new ilRadioOption(
273 $this->lng->txt('auth_oidc_settings_logout_scope_local'),
275 );
276 $ilias_scope->setInfo($this->lng->txt('auth_oidc_settings_logout_scope_local_info'));
277 $logout_scope->addOption($ilias_scope);
278
279 $form->addItem($logout_scope);
280
281 $use_custom_session = new ilCheckboxInputGUI(
282 $this->lng->txt('auth_oidc_settings_custom_session_duration_type'),
283 'custom_session'
284 );
285 $use_custom_session->setOptionTitle(
286 $this->lng->txt('auth_oidc_settings_custom_session_duration_option')
287 );
288 $use_custom_session->setChecked($this->settings->isCustomSession());
289 $form->addItem($use_custom_session);
290
291 $session = new ilNumberInputGUI(
292 $this->lng->txt('auth_oidc_settings_session_duration'),
293 'session_duration'
294 );
295 $session->setValue((string) $this->settings->getSessionDuration());
296 $session->setSuffix($this->lng->txt('minutes'));
297 $session->setMinValue(5);
298 $session->setMaxValue(1440);
299 $session->setRequired(true);
300 $use_custom_session->addSubItem($session);
301
302 if ($this->checkAccessBool('write')) {
303 $form->addCommandButton('saveSettings', $this->lng->txt('save'));
304 }
305
306 $user_sync = new ilFormSectionHeaderGUI();
307 $user_sync->setTitle($this->lng->txt('auth_oidc_settings_section_user_sync'));
308 $form->addItem($user_sync);
309
310 $sync = new ilCheckboxInputGUI(
311 $this->lng->txt('auth_oidc_settings_user_sync'),
312 'sync'
313 );
314 $sync->setChecked($this->settings->isSyncAllowed());
315 $sync->setInfo($this->lng->txt('auth_oidc_settings_user_sync_info'));
316 $sync->setValue('1');
317 $form->addItem($sync);
318
319 $roles = new ilSelectInputGUI(
320 $this->lng->txt('auth_oidc_settings_default_role'),
321 'role'
322 );
323 $roles->setValue((string) $this->settings->getRole());
324 $roles->setInfo($this->lng->txt('auth_oidc_settings_default_role_info'));
325 $roles->setOptions($this->prepareRoleSelection());
326 $roles->setRequired(true);
327 $sync->addSubItem($roles);
328
329 $user_attr = new ilTextInputGUI(
330 $this->lng->txt('auth_oidc_settings_user_attr'),
331 'username'
332 );
333 $user_attr->setValue($this->settings->getUidField());
334 $user_attr->setRequired(true);
335 $form->addItem($user_attr);
336
337 return $form;
338 }
This class represents a section header in a property form.
This class represents an image file property in a property form.
This class represents a number property in a property form.
This class represents a password property in a property form.
This class represents a property in a property form.
This class represents an option in a radio group.
This class represents a selection list property in a property form.
$client_id
Definition: ltiauth.php:67
$provider
Definition: ltitoken.php:80

References $client_id, $provider, checkAccessBool(), ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ilOpenIdConnectSettings\LOGIN_ELEMENT_TYPE_IMG, ilOpenIdConnectSettings\LOGIN_ELEMENT_TYPE_TXT, ilOpenIdConnectSettings\LOGIN_ENFORCE, ilOpenIdConnectSettings\LOGIN_STANDARD, ilOpenIdConnectSettings\LOGOUT_SCOPE_GLOBAL, ilOpenIdConnectSettings\LOGOUT_SCOPE_LOCAL, prepareRoleSelection(), and settings().

Referenced by saveSettings(), and settings().

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

◆ initUserDefinedFields()

ilOpenIdConnectSettingsGUI::initUserDefinedFields ( )
private

Definition at line 1013 of file class.ilOpenIdConnectSettingsGUI.php.

1013 : void
1014 {
1015 if ($this->user_defined_fields === null) {
1016 $this->user_defined_fields = $this->profile->getAllUserDefinedFields();
1017 }
1018 }

References profile().

+ Here is the call graph for this function:

◆ prepareRoleSelection()

ilOpenIdConnectSettingsGUI::prepareRoleSelection ( bool  $a_with_select_option = true)
private
Returns
array<string, string>

Definition at line 406 of file class.ilOpenIdConnectSettingsGUI.php.

406 : array
407 {
408 $global_roles = ilUtil::_sortIds(
409 $this->review->getGlobalRoles(),
410 'object_data',
411 'title',
412 'obj_id'
413 );
414
415 $select = [];
416 if ($a_with_select_option) {
417 $select[0] = $this->lng->txt('links_select_one');
418 }
419 foreach ($global_roles as $role_id) {
420 if ($role_id === ANONYMOUS_ROLE_ID) {
421 continue;
422 }
423 $select[(string) $role_id] = ilObject::_lookupTitle((int) $role_id);
424 }
425
426 return $select;
427 }
static _lookupTitle(int $obj_id)
static _sortIds(array $a_ids, string $a_table, string $a_field, string $a_id_name)
Function that sorts ids by a given table field using WHERE IN E.g: __sort(array(6,...
const ANONYMOUS_ROLE_ID
Definition: constants.php:28

References ilObject\_lookupTitle(), ilUtil\_sortIds(), ANONYMOUS_ROLE_ID, and ILIAS\Repository\lng().

Referenced by initRolesForm(), initSettingsForm(), and saveRoles().

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

◆ profile()

ilOpenIdConnectSettingsGUI::profile ( )
private

Definition at line 429 of file class.ilOpenIdConnectSettingsGUI.php.

429 : void
430 {
431 $this->checkAccess('read');
432
434
435 $this->chooseMapping();
436 $this->userMapping();
437 }

References checkAccess(), chooseMapping(), redirectToSettingsScreenIfNoURLIsConfigured(), and userMapping().

Referenced by __construct(), initUserDefinedFields(), and saveProfileMapping().

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

◆ redirectToSettingsScreenIfNoURLIsConfigured()

ilOpenIdConnectSettingsGUI::redirectToSettingsScreenIfNoURLIsConfigured ( )
private

Definition at line 1052 of file class.ilOpenIdConnectSettingsGUI.php.

1052 : void
1053 {
1054 $url = $this->settings->getProvider();
1055 if ($url === '') {
1056 $this->tpl->setOnScreenMessage(
1057 $this->tpl::MESSAGE_TYPE_FAILURE,
1058 $this->lng->txt('permission_denied'),
1059 true
1060 );
1061 $this->ctrl->redirect($this, 'settings');
1062 }
1063 }

References $url, ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), and settings().

Referenced by profile(), roles(), and scopes().

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

◆ roles()

ilOpenIdConnectSettingsGUI::roles ( ?ilPropertyFormGUI  $form = null)
private

Definition at line 728 of file class.ilOpenIdConnectSettingsGUI.php.

728 : void
729 {
730 $this->checkAccess('read');
731
733
734 $this->setSubTabs(self::STAB_ROLES);
735
736 if (!$form instanceof ilPropertyFormGUI) {
737 $form = $this->initRolesForm();
738 }
739
740 $this->mainTemplate->setContent($form->getHTML());
741 }

References checkAccess(), initRolesForm(), mainTemplate(), redirectToSettingsScreenIfNoURLIsConfigured(), and setSubTabs().

Referenced by saveRoles().

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

◆ saniziteArrayElementsTrafo()

ilOpenIdConnectSettingsGUI::saniziteArrayElementsTrafo ( )
private

Definition at line 1065 of file class.ilOpenIdConnectSettingsGUI.php.

1066 {
1067 return $this->refinery->custom()->transformation(static function (array $values): array {
1068 return ilArrayUtil::stripSlashesRecursive($values);
1069 });
1070 }
static stripSlashesRecursive($a_data, bool $a_strip_html=true, string $a_allow="")
A transformation is a function from one datatype to another.

References ILIAS\Repository\refinery(), and ilArrayUtil\stripSlashesRecursive().

+ Here is the call graph for this function:

◆ saveImageFromHttpRequest()

ilOpenIdConnectSettingsGUI::saveImageFromHttpRequest ( )
private

Definition at line 381 of file class.ilOpenIdConnectSettingsGUI.php.

381 : void
382 {
383 try {
384 if (!$this->upload->hasBeenProcessed()) {
385 $this->upload->process();
386 }
387
388 foreach ($this->upload->getResults() as $single_file_upload) {
389 if ($single_file_upload->isOK()) {
390 $this->settings->deleteImageFile();
391 $this->upload->moveFilesTo(
393 \ILIAS\FileUpload\Location::WEB
394 );
395 $this->settings->setLoginElementImage($single_file_upload->getName());
396 }
397 }
398 } catch (\ILIAS\Filesystem\Exception\IllegalStateException $e) {
399 $this->logger->warning('Upload failed with message: ' . $e->getMessage());
400 }
401 }
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.

References Vendor\Package\$e, ilOpenIdConnectSettings\FILE_STORAGE, ILIAS\Repository\logger(), settings(), and ILIAS\Repository\upload().

Referenced by saveSettings().

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

◆ saveProfileMapping()

ilOpenIdConnectSettingsGUI::saveProfileMapping ( )
private

Definition at line 672 of file class.ilOpenIdConnectSettingsGUI.php.

672 : void
673 {
674 $this->checkAccessBool('write');
675
676 $form = $this->initUserMappingForm();
677 if ($this->request->getMethod() === 'POST' &&
678 $this->request->getQueryParams()['opic'] === 'opic_user_data_mapping') {
679 $request_form = $form->withRequest($this->request);
680 $result = $request_form->getData();
681 if ($result === null) {
682 $this->mainTemplate->setOnScreenMessage('failure', $this->lng->txt('err_check_input'));
683 $this->profile();
684 return;
685 }
686
687 foreach ($this->settings->getProfileMappingFields() as $field => $lng_key) {
688 $this->updateProfileMappingFieldValue($field);
689 }
690
691 foreach ($this->user_defined_fields as $field) {
692 $field = self::UDF_STRING . $field->getIdentifier();
693 $this->updateProfileMappingFieldValue($field->getIdentifier());
694 }
695 }
696
697 $this->settings->save();
698
699 $this->mainTemplate->setOnScreenMessage('success', $this->lng->txt('settings_saved'), true);
700 $this->ctrl->redirect($this, self::STAB_PROFILE);
701 }

References checkAccessBool(), ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), mainTemplate(), profile(), settings(), and updateProfileMappingFieldValue().

+ Here is the call graph for this function:

◆ saveRoles()

ilOpenIdConnectSettingsGUI::saveRoles ( )
private

Definition at line 775 of file class.ilOpenIdConnectSettingsGUI.php.

775 : void
776 {
777 $this->checkAccess('write');
778
779 $form = $this->initRolesForm();
780 if ($form->checkInput()) {
781 $this->logger->dump($this->body, ilLogLevel::DEBUG);
782
783 $role_settings = [];
784 $role_valid = true;
785 foreach ($this->prepareRoleSelection(false) as $role_id => $role_title) {
786 $role_settings[(int) $role_id]['update'] = !$form->getInput('role_map_update_' . $role_id);
787 $role_settings[(int) $role_id]['value'] = '';
788
789 $input_role = trim($form->getInput('role_map_' . $role_id));
790 if ($input_role === '') {
791 continue;
792 }
793
794 $role_params = explode('::', $input_role);
795 $this->logger->dump($role_params, ilLogLevel::DEBUG);
796
797 if (count($role_params) !== 2) {
798 if ($form->getItemByPostVar('role_map_' . $role_id)) {
799 $form->getItemByPostVar('role_map_' . $role_id)->setAlert($this->lng->txt('msg_wrong_format'));
800 }
801 $role_valid = false;
802 continue;
803 }
804 $role_settings[(int) $role_id]['value'] = $input_role;
805 }
806
807 if (!$role_valid) {
808 $form->setValuesByPost();
809 $this->mainTemplate->setOnScreenMessage('failure', $this->lng->txt('err_check_input'));
810 $this->roles($form);
811 return;
812 }
813
814 $this->settings->setRoleMappings($role_settings);
815 $this->settings->save();
816 $this->mainTemplate->setOnScreenMessage('success', $this->lng->txt('settings_saved'), true);
817 $this->ctrl->redirect($this, 'roles');
818 }
819
820 $form->setValuesByPost();
821
822 $this->mainTemplate->setOnScreenMessage('failure', $this->lng->txt('err_check_input'));
823
824 $this->roles($form);
825 }
roles(?ilPropertyFormGUI $form=null)

References checkAccess(), ILIAS\Repository\ctrl(), ilLogLevel\DEBUG, initRolesForm(), ILIAS\Repository\int(), ILIAS\Repository\lng(), ILIAS\Repository\logger(), mainTemplate(), prepareRoleSelection(), roles(), and settings().

+ Here is the call graph for this function:

◆ saveScopes()

ilOpenIdConnectSettingsGUI::saveScopes ( )
private

Definition at line 557 of file class.ilOpenIdConnectSettingsGUI.php.

557 : void
558 {
559 $this->checkAccess('write');
560
561 $validation = false;
562 $type = null;
563 $url = null;
564 $custom_scopes = [];
565
566 $form = $this->initScopesForm();
567 if ($this->request->getMethod() === 'POST') {
568 $request_form = $form->withRequest($this->request);
569 $result = $request_form->getData();
570 if ($result === null) {
571 $this->mainTemplate->setOnScreenMessage('failure', $this->lng->txt('err_check_input'));
572 $this->scopes();
573 return;
574 }
575
576 foreach ($form->getInputs() as $group => $groups) {
577 foreach ($groups->getInputs() as $key => $input) {
578 $dedicated_name = $input->getDedicatedName();
579 $result_data = $result[$group][$key];
580 if ($dedicated_name === 'validate_scopes') {
581 $type = (int) $result_data[0];
582 $url = array_pop($result_data[1]);
583 } elseif ($dedicated_name === 'custom_scope') {
584 $custom_scopes = $result_data;
585 }
586 }
587 }
588
589 if ($url === null && $type === ilOpenIdConnectSettings::URL_VALIDATION_PROVIDER) {
590 $url = $this->settings->getProvider();
591 }
592 $validation = $this->validateDiscoveryUrl($type, $url, $custom_scopes);
593 }
594
595 if ($validation) {
596 $this->settings->setAdditionalScopes((array) $custom_scopes);
597 $this->settings->setValidateScopes((int) $type);
598 if (ilOpenIdConnectSettings::URL_VALIDATION_CUSTOM === $this->settings->getValidateScopes()) {
599 $this->settings->setCustomDiscoveryUrl($url);
600 }
601 $this->settings->save();
602 $this->mainTemplate->setOnScreenMessage('success', $this->lng->txt('settings_saved'), true);
603 $this->ctrl->redirect($this, 'scopes');
604 }
605
606 if ($this->failed_validation_messages !== '') {
607 $this->failed_validation_messages = $this->lng->txt(
608 'err_check_input'
610 } else {
611 $this->failed_validation_messages = $this->lng->txt('err_check_input');
612 }
613
614 $this->mainTemplate->setOnScreenMessage('failure', $this->failed_validation_messages, true);
615 $this->ctrl->redirect($this, 'scopes');
616 }
validateDiscoveryUrl(int $type, ?string $url, array $scopes)

References $failed_validation_messages, $url, checkAccess(), ILIAS\Repository\ctrl(), ILIAS\Repository\int(), ILIAS\Repository\lng(), mainTemplate(), scopes(), settings(), ilOpenIdConnectSettings\URL_VALIDATION_CUSTOM, ilOpenIdConnectSettings\URL_VALIDATION_PROVIDER, and validateDiscoveryUrl().

+ Here is the call graph for this function:

◆ saveSettings()

ilOpenIdConnectSettingsGUI::saveSettings ( )
private

Definition at line 340 of file class.ilOpenIdConnectSettingsGUI.php.

340 : void
341 {
342 $this->checkAccess('write');
343
344 $form = $this->initSettingsForm();
345 if (!$form->checkInput()) {
346 $this->mainTemplate->setOnScreenMessage('failure', $this->lng->txt('err_check_input'));
347 $form->setValuesByPost();
348 $this->settings($form);
349 return;
350 }
351
352 $this->settings->setActive((bool) $form->getInput('activation'));
353 $this->settings->setProvider((string) $form->getInput('provider'));
354 $this->settings->setClientId((string) $form->getInput('client_id'));
355 if ((string) $form->getInput('secret') !== '' && strcmp($form->getInput('secret'), '******') !== 0) {
356 $this->settings->setSecret((string) $form->getInput('secret'));
357 }
358
359 $this->settings->setLoginElementType((int) $form->getInput('le'));
360 $this->settings->setLoginElementText((string) $form->getInput('le_text'));
361 $this->settings->setLoginPromptType((int) $form->getInput('login_prompt'));
362 $this->settings->setLogoutScope((int) $form->getInput('logout_scope'));
363 $this->settings->useCustomSession((bool) $form->getInput('custom_session'));
364 $this->settings->setSessionDuration((int) $form->getInput('session_duration'));
365 $this->settings->allowSync((bool) $form->getInput('sync'));
366 $this->settings->setRole((int) $form->getInput('role'));
367 $this->settings->setUidField((string) $form->getInput('username'));
368
369 $fileData = (array) $form->getInput('le_img');
370
371 if ((string) ($fileData['tmp_name'] ?? '') !== '') {
373 }
374
375 $this->settings->save();
376
377 $this->mainTemplate->setOnScreenMessage('success', $this->lng->txt('settings_saved'), true);
378 $this->ctrl->redirect($this, 'settings');
379 }

References checkAccess(), ILIAS\Repository\ctrl(), initSettingsForm(), ILIAS\Repository\lng(), mainTemplate(), saveImageFromHttpRequest(), and settings().

+ Here is the call graph for this function:

◆ scopes()

ilOpenIdConnectSettingsGUI::scopes ( )
private

Definition at line 439 of file class.ilOpenIdConnectSettingsGUI.php.

439 : void
440 {
441 $this->checkAccess('read');
442
444
445 $this->setSubTabs(self::STAB_SCOPES);
446 $url = $this->settings->getProvider();
447 if ($url !== '') {
448 $this->toolbar->setFormAction($this->ctrl->getFormAction($this));
449 $this->toolbar->addFormButton($this->lng->txt('auth_oidc_discover_scopes'), 'discoverScopesFromServer');
450 }
451
452 $form = $this->initScopesForm();
453 $this->tpl->setContent($this->renderer->render($form));
454 }

References $url, checkAccess(), ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), redirectToSettingsScreenIfNoURLIsConfigured(), renderer(), setSubTabs(), settings(), and ILIAS\Repository\toolbar().

Referenced by discoverScopesFromServer(), saveScopes(), and validateDiscoveryUrl().

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

◆ setSubTabs()

ilOpenIdConnectSettingsGUI::setSubTabs ( string  $active_tab)
private

Definition at line 827 of file class.ilOpenIdConnectSettingsGUI.php.

827 : void
828 {
829 $this->tabs->addSubTab(
830 self::STAB_SETTINGS,
831 $this->lng->txt('auth_oidc_' . self::STAB_SETTINGS),
832 $this->ctrl->getLinkTarget($this, self::STAB_SETTINGS)
833 );
834
835 $url = $this->settings->getProvider();
836 if ($url !== '') {
837 $this->tabs->addSubTab(
838 self::STAB_SCOPES,
839 $this->lng->txt('auth_oidc_' . self::STAB_SCOPES),
840 $this->ctrl->getLinkTarget($this, self::STAB_SCOPES)
841 );
842
843 $this->tabs->addSubTab(
844 self::STAB_PROFILE,
845 $this->lng->txt('auth_oidc_' . self::STAB_PROFILE),
846 $this->ctrl->getLinkTarget($this, self::STAB_PROFILE)
847 );
848 $this->tabs->addSubTab(
849 self::STAB_ROLES,
850 $this->lng->txt('auth_oidc_' . self::STAB_ROLES),
851 $this->ctrl->getLinkTarget($this, self::STAB_ROLES)
852 );
853 }
854
855 $this->tabs->activateSubTab($active_tab);
856 }

References $url, ILIAS\Repository\lng(), settings(), and ILIAS\Repository\tabs().

Referenced by chooseMapping(), roles(), scopes(), and settings().

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

◆ settings()

ilOpenIdConnectSettingsGUI::settings ( ?ilPropertyFormGUI  $form = null)
private

Definition at line 142 of file class.ilOpenIdConnectSettingsGUI.php.

142 : void
143 {
144 $this->checkAccess('read');
145
146 $this->setSubTabs(self::STAB_SETTINGS);
147
148 if (!$form instanceof ilPropertyFormGUI) {
149 $form = $this->initSettingsForm();
150 }
151
152 $this->mainTemplate->setContent($form->getHTML());
153 }

References checkAccess(), initSettingsForm(), mainTemplate(), and setSubTabs().

Referenced by __construct(), buildScopeSelection(), buildUserMappingInputFormUDF(), buildUserMappingInputForUserData(), discoverScopesFromServer(), initAttributeMapping(), initRolesForm(), initSettingsForm(), redirectToSettingsScreenIfNoURLIsConfigured(), saveImageFromHttpRequest(), saveProfileMapping(), saveRoles(), saveScopes(), saveSettings(), scopes(), setSubTabs(), updateProfileMappingFieldValue(), and validateDiscoveryUrl().

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

◆ showInfoMessage()

ilOpenIdConnectSettingsGUI::showInfoMessage ( )
private

Definition at line 872 of file class.ilOpenIdConnectSettingsGUI.php.

872 : void
873 {
874 if ($this->mapping_template === self::VIEW_TAB_EFFECTIVE_MAPPING) {
875 $url = $this->renderer->render(
876 $this->factory->link()->standard(
877 $this->lng->txt('auth_oidc_here'),
878 'https://openid.net/specs/openid-connect-core-1_0.html#StandardClaims'
879 )->withOpenInNewViewport(true)
880 );
881 $message = sprintf($this->lng->txt('auth_odic_scope_tab_info'), $url);
882 } else {
883 $url = $this->renderer->render(
884 $this->factory->link()->standard(
885 $this->lng->txt('auth_oidc_here'),
886 $this->ctrl->getLinkTarget($this, self::STAB_SCOPES)
887 )
888 );
889 $tab_name = $this->lng->txt('auth_oidc_configured_scopes');
890 $message = sprintf($this->lng->txt('auth_odic_scope_info'), $url, $tab_name);
891 }
892
893 $this->mainTemplate->setOnScreenMessage('info', $message);
894 }
$message
Definition: xapiexit.php:31

References $message, $url, factory(), ILIAS\Repository\lng(), mainTemplate(), and renderer().

Referenced by chooseMapping().

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

◆ trimIfStringTrafo()

ilOpenIdConnectSettingsGUI::trimIfStringTrafo ( )
private

Definition at line 1072 of file class.ilOpenIdConnectSettingsGUI.php.

1073 {
1074 return $this->refinery->custom()->transformation(static function ($value) {
1075 if (is_string($value)) {
1076 $value = trim($value);
1077 }
1078
1079 return $value;
1080 });
1081 }

References ILIAS\Repository\refinery().

Referenced by buildScopeSelection(), buildUserMappingInputFormUDF(), and buildUserMappingInputForUserData().

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

◆ updateProfileMappingFieldValue()

ilOpenIdConnectSettingsGUI::updateProfileMappingFieldValue ( string  $field)
private

Definition at line 703 of file class.ilOpenIdConnectSettingsGUI.php.

703 : void
704 {
705 $form = $this->initUserMappingForm();
706 $request_form = $form->withRequest($this->request);
707 $result = $request_form->getData();
708 foreach ($form->getInputs() as $group => $groups) {
709 foreach ($groups->getInputs() as $key => $input) {
710 $dedicated_name = $input->getDedicatedName();
711 $result_data = $result[$group][$key];
712
713 if ($dedicated_name === $field . self::VALUE_STRING) {
714 $this->settings->setProfileMappingFieldValue(
715 $field,
716 $result_data
717 );
718 } elseif ($dedicated_name === $field . self::UPDATE_STRING) {
719 $this->settings->setProfileMappingFieldUpdate(
720 $field,
721 (bool) $result_data
722 );
723 }
724 }
725 }
726 }

References settings().

Referenced by saveProfileMapping().

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

◆ userMapping()

ilOpenIdConnectSettingsGUI::userMapping ( )
private

Definition at line 1020 of file class.ilOpenIdConnectSettingsGUI.php.

1020 : void
1021 {
1022 $form = $this->initUserMappingForm();
1023
1024 $request_wrapper = $this->http->wrapper()->query();
1026
1027 $target = $this->http->request()->getRequestTarget();
1028 if ($request_wrapper->has(self::POST_VALUE) && $request_wrapper->retrieve(
1029 self::POST_VALUE,
1030 $this->refinery->kindlyTo()->int()
1031 )) {
1032 $active = $request_wrapper->retrieve(self::POST_VALUE, $this->refinery->kindlyTo()->int());
1033 }
1034
1035 $actions = [
1036 $this->lng->txt('auth_oidc_saved_values') => "$target&" . self::POST_VALUE . '=' . self::SAVED_VALUES,
1037 $this->lng->txt(
1039 ) => "$target&" . self::POST_VALUE . '=' . self::DEFAULT_VALUES,
1040 ];
1041
1042 $aria_label = 'change_the_currently_displayed_mode';
1043 $active_label = $this->lng->txt('auth_oidc_saved_values');
1044 if ($active !== self::EFFECTIVE_ATTRIBUTE_MAPPING_TAB) {
1046 }
1047 $view_control = $this->factory->viewControl()->mode($actions, $aria_label)->withActive($active_label);
1048
1049 $this->tpl->setContent($this->renderer->render([$view_control, $form]));
1050 }

References ILIAS\UI\examples\Layout\Page\Standard\$request_wrapper, DEFAULT_VALUES, EFFECTIVE_ATTRIBUTE_MAPPING_TAB, factory(), ILIAS\FileDelivery\http(), ILIAS\Repository\lng(), ilOpenIdAttributeMappingTemplate\OPEN_ID_CONFIGURED_SCOPES, ILIAS\Repository\refinery(), renderer(), and SAVED_VALUES.

Referenced by chooseMapping(), initAttributeMapping(), and profile().

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

◆ validateDiscoveryUrl()

ilOpenIdConnectSettingsGUI::validateDiscoveryUrl ( int  $type,
?string  $url,
array  $scopes 
)
private
Parameters
list<string>$scopes

Definition at line 621 of file class.ilOpenIdConnectSettingsGUI.php.

621 : bool
622 {
623 try {
624 switch ($type) {
627 break;
629 $discoveryURL = $url;
630 break;
631 default:
632 $discoveryURL = null;
633 break;
634 }
635
636 $validation_result = $discoveryURL !== null ? $this->settings->validateScopes(
637 $discoveryURL,
638 $scopes
639 ) : [];
640 if (!empty($validation_result)) {
641 if (ilOpenIdConnectSettings::VALIDATION_ISSUE_INVALID_SCOPE === $validation_result[0]) {
642 $this->failed_validation_messages =
643 sprintf(
644 $this->lng->txt('auth_oidc_settings_invalid_scopes'),
645 implode(',', $validation_result[1])
646 );
647 } else {
648 $this->failed_validation_messages = sprintf(
649 $this->lng->txt('auth_oidc_settings_discovery_error'),
650 $validation_result[1]
651 );
652 }
653 $this->scopes();
654
655 return false;
656 }
657 } catch (ilCurlConnectionException $e) {
658 $this->mainTemplate->setOnScreenMessage(
659 'failure',
660 $e->getMessage(),
661 true
662 );
663 $this->failed_validation_messages = $e->getMessage();
664 $this->scopes();
665
666 return false;
667 }
668
669 return true;
670 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$scopes
Definition: ltitoken.php:96

References Vendor\Package\$e, $scopes, $url, ILIAS\Repository\lng(), mainTemplate(), scopes(), settings(), ilOpenIdConnectSettings\URL_VALIDATION_CUSTOM, ilOpenIdConnectSettings\URL_VALIDATION_PROVIDER, URL_VALIDATION_PROVIDER_STRING, and ilOpenIdConnectSettings\VALIDATION_ISSUE_INVALID_SCOPE.

Referenced by saveScopes().

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

Field Documentation

◆ $access

readonly ilAccessHandler ilOpenIdConnectSettingsGUI::$access
private

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

◆ $attribute_mapping_template

ilOpenIdAttributeMappingTemplate ilOpenIdConnectSettingsGUI::$attribute_mapping_template
private

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

◆ $body

array ilOpenIdConnectSettingsGUI::$body
private

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

◆ $ctrl

readonly ilCtrl ilOpenIdConnectSettingsGUI::$ctrl
private

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

◆ $error

readonly ilErrorHandling ilOpenIdConnectSettingsGUI::$error
private

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

◆ $factory

Factory ilOpenIdConnectSettingsGUI::$factory
private

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

◆ $failed_validation_messages

string ilOpenIdConnectSettingsGUI::$failed_validation_messages = ''
private

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

Referenced by saveScopes().

◆ $http

Services ilOpenIdConnectSettingsGUI::$http
private

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

◆ $lng

readonly ilLanguage ilOpenIdConnectSettingsGUI::$lng
private

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

◆ $logger

readonly ilLogger ilOpenIdConnectSettingsGUI::$logger
private

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

◆ $mainTemplate

readonly ilGlobalTemplateInterface ilOpenIdConnectSettingsGUI::$mainTemplate
private

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

◆ $mapping_template

int ilOpenIdConnectSettingsGUI::$mapping_template = self::VIEW_TAB_EFFECTIVE_MAPPING
private

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

◆ $profile

readonly Profile ilOpenIdConnectSettingsGUI::$profile
private

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

◆ $ref_id

int ilOpenIdConnectSettingsGUI::$ref_id
private

Definition at line 48 of file class.ilOpenIdConnectSettingsGUI.php.

◆ $refinery

ILIAS Refinery Factory ilOpenIdConnectSettingsGUI::$refinery
private

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

Referenced by __construct().

◆ $renderer

Renderer ilOpenIdConnectSettingsGUI::$renderer
private

Definition at line 72 of file class.ilOpenIdConnectSettingsGUI.php.

◆ $request

ServerRequestInterface ilOpenIdConnectSettingsGUI::$request
private

Definition at line 69 of file class.ilOpenIdConnectSettingsGUI.php.

◆ $review

readonly ilRbacReview ilOpenIdConnectSettingsGUI::$review
private

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

◆ $settings

readonly ilOpenIdConnectSettings ilOpenIdConnectSettingsGUI::$settings
private

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

◆ $tabs

readonly ilTabsGUI ilOpenIdConnectSettingsGUI::$tabs
private

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

◆ $toolbar

ilToolbarGUI ilOpenIdConnectSettingsGUI::$toolbar
private

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

◆ $tpl

ilGlobalTemplateInterface ilOpenIdConnectSettingsGUI::$tpl
private

Definition at line 67 of file class.ilOpenIdConnectSettingsGUI.php.

◆ $ui

Factory ilOpenIdConnectSettingsGUI::$ui
private

Definition at line 71 of file class.ilOpenIdConnectSettingsGUI.php.

◆ $upload

readonly FileUpload ilOpenIdConnectSettingsGUI::$upload
private

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

◆ $user_defined_fields

array ilOpenIdConnectSettingsGUI::$user_defined_fields = null
private

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

◆ DEFAULT_CMD

const ilOpenIdConnectSettingsGUI::DEFAULT_CMD = 'settings'
private

Definition at line 39 of file class.ilOpenIdConnectSettingsGUI.php.

◆ DEFAULT_VALUES

const ilOpenIdConnectSettingsGUI::DEFAULT_VALUES = 1
private

Definition at line 40 of file class.ilOpenIdConnectSettingsGUI.php.

Referenced by userMapping().

◆ EFFECTIVE_ATTRIBUTE_MAPPING_TAB

const ilOpenIdConnectSettingsGUI::EFFECTIVE_ATTRIBUTE_MAPPING_TAB = 2
private

Definition at line 46 of file class.ilOpenIdConnectSettingsGUI.php.

Referenced by userMapping().

◆ POST_VALUE

const ilOpenIdConnectSettingsGUI::POST_VALUE = 'Mode'
private

Definition at line 42 of file class.ilOpenIdConnectSettingsGUI.php.

◆ SAVED_VALUES

const ilOpenIdConnectSettingsGUI::SAVED_VALUES = 2
private

Definition at line 41 of file class.ilOpenIdConnectSettingsGUI.php.

Referenced by userMapping().

◆ STAB_PROFILE

const ilOpenIdConnectSettingsGUI::STAB_PROFILE = 'profile'
private

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

◆ STAB_ROLES

const ilOpenIdConnectSettingsGUI::STAB_ROLES = 'roles'
private

Definition at line 35 of file class.ilOpenIdConnectSettingsGUI.php.

◆ STAB_SCOPES

const ilOpenIdConnectSettingsGUI::STAB_SCOPES = 'scopes'
private

Definition at line 33 of file class.ilOpenIdConnectSettingsGUI.php.

◆ STAB_SETTINGS

const ilOpenIdConnectSettingsGUI::STAB_SETTINGS = 'settings'
private

Definition at line 32 of file class.ilOpenIdConnectSettingsGUI.php.

◆ UDF_STRING

const ilOpenIdConnectSettingsGUI::UDF_STRING = 'udf_'
private

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

◆ UPDATE_STRING

const ilOpenIdConnectSettingsGUI::UPDATE_STRING = '_update'
private

Definition at line 37 of file class.ilOpenIdConnectSettingsGUI.php.

◆ URL_VALIDATION_PROVIDER_STRING

const ilOpenIdConnectSettingsGUI::URL_VALIDATION_PROVIDER_STRING = '/.well-known/openid-configuration'
private

◆ VALUE_STRING

const ilOpenIdConnectSettingsGUI::VALUE_STRING = '_value'
private

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

◆ VIEW_TAB_EFFECTIVE_MAPPING

const ilOpenIdConnectSettingsGUI::VIEW_TAB_EFFECTIVE_MAPPING = 2
private

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

◆ VIEW_TAB_PRE_FILED

const ilOpenIdConnectSettingsGUI::VIEW_TAB_PRE_FILED = 1
private

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


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