diff --git a/lib/SAMLSettings.php b/lib/SAMLSettings.php index 799876bd7..6d29d11a0 100644 --- a/lib/SAMLSettings.php +++ b/lib/SAMLSettings.php @@ -59,6 +59,7 @@ class SAMLSettings { 'saml-attribute-mapping-group_mapping_prefix', 'saml-user-filter-reject_groups', 'saml-user-filter-require_groups', + 'sp-entityId', 'sp-x509cert', 'sp-name-id-format', 'sp-privateKey', @@ -141,7 +142,9 @@ public function getOneLoginSettingsArray(int $idp): array { // "sloWebServerDecode" is not expected to be passed to the OneLogin class ], 'sp' => [ - 'entityId' => $this->urlGenerator->linkToRouteAbsolute('user_saml.SAML.getMetadata'), + 'entityId' => (array_key_exists('sp-entityId', $this->configurations[$idp]) && trim($this->configurations[$idp]['sp-entityId']) != '') + ? $this->configurations[$idp]['sp-entityId'] + : $this->urlGenerator->linkToRouteAbsolute('user_saml.SAML.getMetadata'), 'assertionConsumerService' => [ 'url' => $this->urlGenerator->linkToRouteAbsolute('user_saml.SAML.assertionConsumerService'), ], diff --git a/lib/Settings/Admin.php b/lib/Settings/Admin.php index bce34eee5..a72b253ba 100644 --- a/lib/Settings/Admin.php +++ b/lib/Settings/Admin.php @@ -38,8 +38,21 @@ public function getForm() { ]; } $serviceProviderFields = [ - 'x509cert' => $this->l10n->t('X.509 certificate of the Service Provider'), - 'privateKey' => $this->l10n->t('Private key of the Service Provider'), + 'x509cert' => [ + 'text' => $this->l10n->t('X.509 certificate of the Service Provider'), + 'type' => 'text', + 'required' => false, + ], + 'privateKey' => [ + 'text' => $this->l10n->t('Private key of the Service Provider'), + 'type' => 'text', + 'required' => false, + ], + 'entityId' => [ + 'text' => $this->l10n->t('Service Provider EntityId (optional)'), + 'type' => 'line', + 'required' => false, + ] ]; $securityOfferFields = [ 'nameIdEncrypted' => $this->l10n->t('Indicates that the nameID of the sent by this SP will be encrypted.'), diff --git a/templates/admin.php b/templates/admin.php index 7cda20d10..733a39a30 100644 --- a/templates/admin.php +++ b/templates/admin.php @@ -121,10 +121,14 @@ } ?> > - $text): ?> + $attribute): ?>

-
- +
+ + class="required"/> + + +

diff --git a/tests/unit/Settings/AdminTest.php b/tests/unit/Settings/AdminTest.php index 9528007b3..6ac3c4457 100644 --- a/tests/unit/Settings/AdminTest.php +++ b/tests/unit/Settings/AdminTest.php @@ -53,8 +53,21 @@ public function formDataProvider() { }); $serviceProviderFields = [ - 'x509cert' => 'X.509 certificate of the Service Provider', - 'privateKey' => 'Private key of the Service Provider', + 'x509cert' => [ + 'text' => 'X.509 certificate of the Service Provider', + 'type' => 'text', + 'required' => false, + ], + 'privateKey' => [ + 'text' => 'Private key of the Service Provider', + 'type' => 'text', + 'required' => false, + ], + 'entityId' => [ + 'text' => 'Service Provider EntityId (optional)', + 'type' => 'line', + 'required' => false, + ] ]; $securityOfferFields = [ 'nameIdEncrypted' => 'Indicates that the nameID of the sent by this SP will be encrypted.',