diff --git a/modules/saml/docs/sp.txt b/modules/saml/docs/sp.txt index 6390e1a471a5aa9478cc01b2ebecea758a30903f..3d1f382b783e70ab2f58b5835cd94d1f211a9f3b 100644 --- a/modules/saml/docs/sp.txt +++ b/modules/saml/docs/sp.txt @@ -169,6 +169,35 @@ Options : *Note 2*: SAML 2 specific. +`OrganizationName` +: The name of the organization responsible for this SP. + This name does not need to be suitable for display to end users. + +: This option can be translated into multiple languages by specifying the value as an array of language-code to translated name: + + 'OrganizationName' => array( + 'en' => 'Example organization', + 'no' => 'Eksempel organisation', + ), + +: *Note*: If you specify this option, you must also specify the `OrganizationURL` option. + +`OrganizationDisplayName` +: The name of the organization responsible for this SP. + This name must be suitable for display to end users. + If this option isn't specified, `OrganizationName` will be used instead. + +: This option can be translated into multiple languages by specifying the value as an array of language-code to translated name. + +: *Note*: If you specify this option, you must also specify the `OrganizationName` option. + +`OrganizationURL` +: An URL the end user can access for more information about the organization. + +: This option can be translated into multiple languages by specifying the value as an array of language-code to translated URL. + +: *Note*: If you specify this option, you must also specify the `OrganizationName` option. + `privatekey` : File name of private key to be used for signing messages and decrypting messages from the IdP. This option is only required if you use encrypted assertions or if you enable signing of messages. diff --git a/modules/saml/www/sp/metadata.php b/modules/saml/www/sp/metadata.php index c64da9269151e35b7a1bc8784891da414fae87a3..f228a9bb30b6e39ab52c38c5d08533a10f2635a9 100644 --- a/modules/saml/www/sp/metadata.php +++ b/modules/saml/www/sp/metadata.php @@ -77,6 +77,24 @@ $metaBuilder = new SimpleSAML_Metadata_SAMLBuilder($entityId); $metaBuilder->addMetadataSP11($metaArray11); $metaBuilder->addMetadataSP20($metaArray20); + +$orgName = $spconfig->getLocalizedString('OrganizationName', NULL); +if ($orgName !== NULL) { + + $orgDisplayName = $spconfig->getLocalizedString('OrganizationDisplayName', NULL); + if ($orgDisplayName === NULL) { + $orgDisplayName = $orgName; + } + + $orgURL = $spconfig->getLocalizedString('OrganizationURL', NULL); + if ($orgURL === NULL) { + throw new SimpleSAML_Error_Exception('If OrganizationName is set, OrganizationURL must also be set.'); + } + + + $metaBuilder->addOrganization($orgName, $orgDisplayName, $orgURL); +} + $config = SimpleSAML_Configuration::getInstance(); $metaBuilder->addContact('technical', array( 'emailAddress' => $config->getString('technicalcontact_email', NULL),