Revision: 2162
Author: olavmrk
Date: Mon Feb  8 01:13:00 2010
Log: saml/sp: Add organization information to metadata.
http://code.google.com/p/simplesamlphp/source/detail?r=2162

Modified:
 /trunk/modules/saml/docs/sp.txt
 /trunk/modules/saml/www/sp/metadata.php

=======================================
--- /trunk/modules/saml/docs/sp.txt     Tue Jan  5 05:52:11 2010
+++ /trunk/modules/saml/docs/sp.txt     Mon Feb  8 01:13:00 2010
@@ -169,6 +169,35 @@

 :   *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.

=======================================
--- /trunk/modules/saml/www/sp/metadata.php     Thu Nov 26 01:18:16 2009
+++ /trunk/modules/saml/www/sp/metadata.php     Mon Feb  8 01:13:00 2010
@@ -76,6 +76,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(

--
You received this message because you are subscribed to the Google Groups 
"simpleSAMLphp commits" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/simplesamlphp-commits?hl=en.

Reply via email to