Skip to content
Snippets Groups Projects
Commit c61e6080 authored by Olav Morken's avatar Olav Morken
Browse files

Extended MetaShare publish to support SAML 2.0 SP & Shib 1.3 IdP/SP metadata.

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@683 44740490-163a-0410-bde0-09ae8108e29a
parent 6518ea51
No related branches found
No related tags found
No related merge requests found
...@@ -536,9 +536,18 @@ $lang = array( ...@@ -536,9 +536,18 @@ $lang = array(
'hr' => 'Održavanje i konfiguriranje simpleSAMLphp-a', 'hr' => 'Održavanje i konfiguriranje simpleSAMLphp-a',
'hu' => 'SimpleSAMLphp karbantartása és beállítása', 'hu' => 'SimpleSAMLphp karbantartása és beállítása',
), ),
'link_publish' => array ( 'link_publish_saml20-idp' => array (
'en' => 'Publish my SAML 2.0 IdP metadata to the configured MetaShare', 'en' => 'Publish my SAML 2.0 IdP metadata to the configured MetaShare',
), ),
'link_publish_saml20-sp' => array (
'en' => 'Publish my SAML 2.0 SP metadata to the configured MetaShare',
),
'link_publish_shib13-idp' => array (
'en' => 'Publish my Shib 1.3 IdP metadata to the configured MetaShare',
),
'link_publish_shib13-sp' => array (
'en' => 'Publish my Shib 1.3 SP metadata to the configured MetaShare',
),
); );
......
...@@ -60,14 +60,25 @@ if($config->getBoolean('idpdisco.enableremember', FALSE)) { ...@@ -60,14 +60,25 @@ if($config->getBoolean('idpdisco.enableremember', FALSE)) {
); );
} }
if ($config->getValue('enable.saml20-idp') === TRUE) {
$publishURL = $config->getString('metashare.publishurl', NULL); $publishURL = $config->getString('metashare.publishurl', NULL);
if ($publishURL !== NULL) { if ($publishURL !== NULL) {
$metadataURL = SimpleSAML_Utilities::resolveURL('saml2/idp/metadata.php'); $metadataSources = array(
$publishURL = SimpleSAML_Utilities::addURLparameter($publishURL, 'url=' . urlencode($metadataURL)); 'saml20-idp' => 'saml2/idp/metadata.php',
'saml20-sp' => 'saml2/sp/metadata.php',
'shib13-idp' => 'shib13/idp/metadata.php',
'shib13-sp' => 'shib13/sp/metadata.php',
);
foreach($metadataSources as $name => $url) {
if(!$config->getBoolean('enable.' . $name, FALSE)) {
continue;
}
$url = SimpleSAML_Utilities::resolveURL($url);
$linkTarget = SimpleSAML_Utilities::addURLparameter($publishURL, 'url=' . urlencode($url));
$links[] = array( $links[] = array(
'href' => $publishURL, 'href' => $linkTarget,
'text' => 'link_publish', 'text' => 'link_publish_' . $name,
); );
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment