Skip to content

Commit 10b7854

Browse files
committed
Added OIDC redirect URI display
1 parent 47ebe8f commit 10b7854

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

src/Form/SettingsForm.php

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use Drupal\Core\Form\FormBase;
66
use Drupal\Core\Form\FormStateInterface;
7+
use Drupal\Core\Link;
78
use Drupal\Core\StringTranslation\StringTranslationTrait;
89
use Drupal\os2forms_nemlogin_openid_connect\Helper\Settings;
910
use Symfony\Component\DependencyInjection\ContainerInterface;
@@ -73,6 +74,34 @@ public function buildForm(array $form, FormStateInterface $form_state): array {
7374
'#value' => $this->t('Save settings'),
7475
];
7576

77+
try {
78+
$providers = Yaml::parse($providers);
79+
80+
$form['info'] = [
81+
'#type' => 'details',
82+
'#open' => TRUE,
83+
'#title' => $this->t('OpenID Connect redirect URIs'),
84+
'#weight' => 9999,
85+
86+
'list' => [
87+
'#type' => 'html_tag',
88+
'#tag' => 'ol',
89+
],
90+
];
91+
92+
foreach ($providers as $id => $provider) {
93+
$form['info']['list'][$id] = [
94+
'#type' => 'html_tag',
95+
'#tag' => 'li',
96+
97+
'link' => Link::createFromRoute($provider, 'os2forms_nemlogin_openid_connect.openid_connect_authenticate', ['id' => $id])->toRenderable(),
98+
];
99+
}
100+
}
101+
catch (\Exception $e) {
102+
// Ignore all exception.
103+
}
104+
76105
return $form;
77106
}
78107

0 commit comments

Comments
 (0)