diff --git a/lib/SimpleSAML/XML/Validator.php b/lib/SimpleSAML/XML/Validator.php index 38f0b7fc8ea5a50b516d72b34aac51eb45b8fba7..314e863b5491f7094270813f786069bb72ed1f7e 100644 --- a/lib/SimpleSAML/XML/Validator.php +++ b/lib/SimpleSAML/XML/Validator.php @@ -97,7 +97,7 @@ class SimpleSAML_XML_Validator { assert('is_string($fingerprint)'); if($this->x509Fingerprint === NULL) { - throw new Exception('Key used to sign the message wasn\'t an X509 certificate.'); + throw new Exception('Key used to sign the message was not an X509 certificate.'); } /* Make sure that the fingerprint is in the correct format. */ @@ -105,7 +105,7 @@ class SimpleSAML_XML_Validator { /* Compare the fingerprints. Throw an exception if they didn't match. */ if ($fingerprint !== $this->x509Fingerprint) { - throw new Exception('Expecting certificate fingerprint [' . $fingerprint . ']but got [' . $this->x509Fingerprint . ']'); + throw new Exception('Expecting certificate fingerprint [' . $fingerprint . '] but got [' . $this->x509Fingerprint . ']'); } /* The fingerprints matched. */ diff --git a/templates/default/en/metadata.php b/templates/default/en/metadata.php index d20aeeb1f3d005c8d94fb0a805ff6eb873fe57a7..704e1799da333f3cc0182beec2b0dbb8a9dac3ab 100644 --- a/templates/default/en/metadata.php +++ b/templates/default/en/metadata.php @@ -12,7 +12,16 @@ <?php } ?> <h2>Metadata</h2> + <p>In SAML 2.0 Meta data XML format:</p> + <pre style="overflow: scroll; border: 1px solid #eee; padding: 2px"><?php echo $data['metadata']; ?></pre> + + + <p>In simpleSAMLphp flat file format - use this if you are using a simpleSAMLphp entity on the other side:</p> + + <pre style="overflow: scroll; border: 1px solid #eee; padding: 2px"><?php echo $data['metadataflat']; ?></pre> + + <?php if(array_key_exists('sendmetadatato', $this->data)) { ?> diff --git a/www/saml2/idp/metadata.php b/www/saml2/idp/metadata.php index 6d62d956c99ab7ecd2f0f1c6c5c1c7c9a290c512..56092530508914f61dc6c372e695f7824543c692 100644 --- a/www/saml2/idp/metadata.php +++ b/www/saml2/idp/metadata.php @@ -41,7 +41,15 @@ try { $data = XMLSecurityDSig::get509XCert($cert, true); - + $metaflat = " + '" . htmlspecialchars($idpentityid) . "' => array( + 'name' => 'Type in a name for this entity', + 'description' => 'and a proper description that would help users know when to select this IdP.', + 'SingleSignOnService' => '" . htmlspecialchars($metadata->getGenerated('SingleSignOnService', 'saml20-idp-hosted')) . "', + 'SingleLogoutService' => '" . htmlspecialchars($metadata->getGenerated('SingleLogoutService', 'saml20-idp-hosted')) . "', + 'certFingerprint' => '" . strtolower(sha1(base64_decode($data))) ."' + ), +"; $metaxml = '<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <EntityDescriptor xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance" xmlns="urn:oasis:names:tc:SAML:2.0:metadata" @@ -99,8 +107,11 @@ try { $et->data['header'] = 'SAML 2.0 IdP Metadata'; + $et->data['metaurl'] = SimpleSAML_Utilities::addURLparameter(SimpleSAML_Utilities::selfURLNoQuery(), 'output=xml'); $et->data['metadata'] = htmlentities($metaxml); + $et->data['metadataflat'] = htmlentities($metaflat); + $et->data['feide'] = in_array($defaultidp, array('sam.feide.no', 'max.feide.no')); $et->data['defaultidp'] = $defaultidp; diff --git a/www/saml2/sp/metadata.php b/www/saml2/sp/metadata.php index 321c94d8ef34af4b8b990574f3406cfdf5f9fdca..30f27dea557049490b7be29ab3a39bc3b00b91a7 100644 --- a/www/saml2/sp/metadata.php +++ b/www/saml2/sp/metadata.php @@ -43,6 +43,13 @@ try { if (!$spmeta['SingleLogOutUrl']) throw new Exception('The following parameter is not set in your SAML 2.0 SP Hosted metadata: SingleLogOutUrl'); */ + $metaflat = " + '" . htmlspecialchars($spentityid) . "' => array( + 'AssertionConsumerService' => '" . htmlspecialchars($metadata->getGenerated('AssertionConsumerService', 'saml20-sp-hosted')) . "', + 'SingleLogoutService' => '" . htmlspecialchars($metadata->getGenerated('SingleLogoutService', 'saml20-sp-hosted')) . "' + ) +"; + $metaxml = '<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <EntityDescriptor entityID="' . htmlspecialchars($spentityid) . '" xmlns="urn:oasis:names:tc:SAML:2.0:metadata"> @@ -74,6 +81,7 @@ try { $et->data['header'] = 'SAML 2.0 SP Metadata'; $et->data['metadata'] = htmlentities($metaxml); + $et->data['metadataflat'] = htmlentities($metaflat); if (array_key_exists($defaultidp, $send_metadata_to_idp)) { $et->data['sendmetadatato'] = $send_metadata_to_idp[$defaultidp]['address'];