diff --git a/lib/SimpleSAML/Metadata/SAMLParser.php b/lib/SimpleSAML/Metadata/SAMLParser.php index e7a50d51760651834c0a83651f54ce96a6653dc3..5545dc91234d69d4c6c7c2f4a1bf44df8d5287dd 100644 --- a/lib/SimpleSAML/Metadata/SAMLParser.php +++ b/lib/SimpleSAML/Metadata/SAMLParser.php @@ -384,7 +384,6 @@ class SimpleSAML_Metadata_SAMLParser { * Add organizational metadata */ if (!empty($this->organizationName)) { - $ret['name'] = $this->organizationName; $ret['description'] = $this->organizationName; $ret['OrganizationName'] = $this->organizationName; } @@ -636,6 +635,11 @@ class SimpleSAML_Metadata_SAMLParser { /* Add extensions. */ $this->addExtensions($ret, $spd); + // prioritize mdui:DisplayName as the name if available + if (isset($ret['UIInfo']) && isset($ret['UIInfo']['DisplayName'])) { + $ret['name'] = $ret['UIInfo']['DisplayName']; + } + return $ret; } @@ -700,6 +704,11 @@ class SimpleSAML_Metadata_SAMLParser { /* Add extensions. */ $this->addExtensions($ret, $idp); + // prioritize mdui:DisplayName as the name if available + if (isset($ret['UIInfo']) && isset($ret['UIInfo']['DisplayName'])) { + $ret['name'] = $ret['UIInfo']['DisplayName']; + } + return $ret; } diff --git a/templates/selectidp-dropdown.php b/templates/selectidp-dropdown.php index 6f54bbf529127cd7f301e8044cc0acd519c3bcdf..2ac0ef87bf7dd180798815e477e335353d3e7689 100644 --- a/templates/selectidp-dropdown.php +++ b/templates/selectidp-dropdown.php @@ -11,6 +11,10 @@ $this->includeAtTemplateBase('includes/header.php'); foreach ($this->data['idplist'] AS $idpentry) { if (isset($idpentry['UIInfo']['DisplayName'])) { + /* TODO: remove this branch, If ['UIInfo']['DisplayName'] is available, it will get through to 'name' in the + * metadata parsed with SSP >= 1.13.0, so this code is no longer necessary. Keep it now to avoid breaking + * metadata parsed with previous versions. + */ $this->includeInlineTranslation('idpname_' . $idpentry['entityid'], $idpentry['UIInfo']['DisplayName']); } elseif (isset($idpentry['name'])) { $this->includeInlineTranslation('idpname_' . $idpentry['entityid'], $idpentry['name']); diff --git a/templates/selectidp-links.php b/templates/selectidp-links.php index 07635251214ef501ab3b62b1e64a977abecaf84d..83a99379f6d1d245a9660b25d3e1c51fd8332b3a 100644 --- a/templates/selectidp-links.php +++ b/templates/selectidp-links.php @@ -11,6 +11,10 @@ $this->includeAtTemplateBase('includes/header.php'); foreach ($this->data['idplist'] AS $idpentry) { if (isset($idpentry['UIInfo']['DisplayName'])) { + /* TODO: remove this branch, If ['UIInfo']['DisplayName'] is available, it will get through to 'name' in the + * metadata parsed with SSP >= 1.13.0, so this code is no longer necessary. Keep it now to avoid breaking + * metadata parsed with previous versions. + */ $this->includeInlineTranslation('idpname_' . $idpentry['entityid'], $idpentry['UIInfo']['DisplayName']); } elseif (isset($idpentry['name'])) { $this->includeInlineTranslation('idpname_' . $idpentry['entityid'], $idpentry['name']);