Skip to content
Snippets Groups Projects
Commit f6a4a0b6 authored by Andreas Åkre Solberg's avatar Andreas Åkre Solberg
Browse files

Creating metadata in simplesamlphp format, not just saml 2 meta data format.

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@301 44740490-163a-0410-bde0-09ae8108e29a
parent 6ac9842f
No related branches found
No related tags found
No related merge requests found
......@@ -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. */
......
......@@ -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)) { ?>
......
......@@ -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;
......
......@@ -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'];
......
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