зеркало из https://github.com/nextcloud/user_saml.git
feat(settings): Add gui settings for passthrough parameters
Signed-off-by: Micke Nordin <kano@sunet.se>
This commit is contained in:
Родитель
8f0693ae3c
Коммит
70c7758ccb
|
@ -150,12 +150,16 @@ class SAMLController extends Controller {
|
|||
$type = $this->config->getAppValue($this->appName, 'type');
|
||||
switch ($type) {
|
||||
case 'saml':
|
||||
$auth = new Auth($this->samlSettings->getOneLoginSettingsArray($idp));
|
||||
$passthroughParams = $this->config->getSystemValue('user_saml.passthrough_parameters', []);
|
||||
$settings= $this->samlSettings->getOneLoginSettingsArray($idp);
|
||||
$auth = new Auth($settings);
|
||||
$passthroughParamsString = trim($settings['passthroughParameters'] ?? '') ;
|
||||
$passthroughParams = array_map('trim', explode(',', $passthroughParamsString));
|
||||
|
||||
$passthroughValues = [];
|
||||
foreach ($passthroughParams as $passthroughParam) {
|
||||
$value = (string)$this->request->getParam($passthroughParam, '');
|
||||
if ($value !== '') {
|
||||
$this->logger->info('Passthrough parameters: ' . $passthroughParam . ' : ' . $value);
|
||||
$passthroughValues[$passthroughParam] = $value;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -57,6 +57,7 @@ class SettingsController extends Controller {
|
|||
'singleSignOnService.url' => ['required' => false],
|
||||
'entityId' => ['required' => false],
|
||||
'x509cert' => ['required' => false],
|
||||
'passthroughParameters' => ['required' => false],
|
||||
];
|
||||
/* Fetch all config values for the given providerId */
|
||||
|
||||
|
|
|
@ -30,6 +30,7 @@ class SAMLSettings {
|
|||
'idp-singleLogoutService.responseUrl',
|
||||
'idp-singleLogoutService.url',
|
||||
'idp-singleSignOnService.url',
|
||||
'passthroughParameters',
|
||||
'idp-x509cert',
|
||||
'security-authnRequestsSigned',
|
||||
'security-general',
|
||||
|
@ -133,6 +134,7 @@ class SAMLSettings {
|
|||
'strict' => true,
|
||||
'debug' => $this->config->getSystemValue('debug', false),
|
||||
'baseurl' => $this->urlGenerator->linkToRouteAbsolute('user_saml.SAML.base'),
|
||||
'passthroughParameters' => $this->configurations[$idp]['passthroughParameters'] ?? '',
|
||||
'security' => [
|
||||
'nameIdEncrypted' => ($this->configurations[$idp]['security-nameIdEncrypted'] ?? '0') === '1',
|
||||
'authnRequestsSigned' => ($this->configurations[$idp]['security-authnRequestsSigned'] ?? '0') === '1',
|
||||
|
|
|
@ -153,6 +153,10 @@ if (isset($_['general']['allow_multiple_user_back_ends']['text'])) {
|
|||
<label class="user-saml-standalone-label" for="user-saml-x509cert"><?php p($l->t('Public X.509 certificate of the IdP')) ?></label><br/>
|
||||
<textarea id="user-saml-x509cert" name="x509cert"><?php p($_['config']['idp-x509cert'] ?? '') ?></textarea>
|
||||
</p>
|
||||
<p>
|
||||
<label class="user-saml-standalone-label" for="user-saml-passthroughParameters"><?php p($l->t('Request parameters to pass-through to IdP (comma separated list)')) ?></label><br/>
|
||||
<input id="user-saml-passthroughParameters" name="passthroughParameters" value="<?php p($_['config']['passthroughParameters'] ?? '') ?>" type="text" placeholder="idp_hint,extra_parameter"/>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче