summaryrefslogtreecommitdiffstats
path: root/lib/SimpleSAML/Metadata/SAMLParser.php
diff options
context:
space:
mode:
authorOlav Morken <olav.morken@uninett.no>2008-09-15 13:52:33 +0000
committerOlav Morken <olav.morken@uninett.no>2008-09-15 13:52:33 +0000
commitfe80b8ad59fd1a07e8ff1eadd234318a083466f5 (patch)
tree443d30db7adf174ac4bda11bedfb8be4d553134b /lib/SimpleSAML/Metadata/SAMLParser.php
parentbbfb2e9e30b1d5f21c82a8fd7342605ea87d455d (diff)
downloadsimplesamlphp-fe80b8ad59fd1a07e8ff1eadd234318a083466f5.zip
simplesamlphp-fe80b8ad59fd1a07e8ff1eadd234318a083466f5.tar.gz
simplesamlphp-fe80b8ad59fd1a07e8ff1eadd234318a083466f5.tar.bz2
Metadata parser - include original EntityDescriptor in metadata.
git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@871 44740490-163a-0410-bde0-09ae8108e29a
Diffstat (limited to 'lib/SimpleSAML/Metadata/SAMLParser.php')
-rw-r--r--lib/SimpleSAML/Metadata/SAMLParser.php18
1 files changed, 15 insertions, 3 deletions
diff --git a/lib/SimpleSAML/Metadata/SAMLParser.php b/lib/SimpleSAML/Metadata/SAMLParser.php
index 49c920d..502f1f5 100644
--- a/lib/SimpleSAML/Metadata/SAMLParser.php
+++ b/lib/SimpleSAML/Metadata/SAMLParser.php
@@ -111,6 +111,12 @@ class SimpleSAML_Metadata_SAMLParser {
/**
+ * The original EntityDescriptor element for this entity, as a base64 encoded string.
+ */
+ private $entityDescriptor;
+
+
+ /**
* This is the constructor for the SAMLParser class.
*
* @param $entityElement The DOMElement which represents the EntityDescriptor-element.
@@ -119,14 +125,16 @@ class SimpleSAML_Metadata_SAMLParser {
* with a Signature element.
* @param int|NULL $expireTime The unix timestamp for when this entity should expire, or NULL if unknwon.
*/
- private function __construct($entityElement, $entitiesValidator, $expireTime) {
+ private function __construct(DOMElement $entityElement, $entitiesValidator, $expireTime) {
+ assert('is_null($entitiesValidator) || $entitiesValidator instanceof SimpleSAML_XML_Validator');
assert('is_null($expireTime) || is_int($expireTime)');
$this->spDescriptors = array();
$this->idpDescriptors = array();
-
- assert('$entityElement instanceof DOMElement');
+ $tmpDoc = new DOMDocument();
+ $tmpDoc->appendChild($tmpDoc->importNode($entityElement, TRUE));
+ $this->entityDescriptor = base64_encode($tmpDoc->saveXML());
/* Extract the entity id from the EntityDescriptor element. This is a required
* attribute, so we throw an exception if it isn't found.
@@ -410,6 +418,7 @@ class SimpleSAML_Metadata_SAMLParser {
$ret = array();
$ret['entityid'] = $this->entityId;
+ $ret['entityDescriptor'] = $this->entityDescriptor;
/* Find SP information which supports one of the SAML 1.x protocols. */
@@ -461,6 +470,7 @@ class SimpleSAML_Metadata_SAMLParser {
$ret = array();
$ret['entityid'] = $this->entityId;
+ $ret['entityDescriptor'] = $this->entityDescriptor;
$ret['name'] = $this->entityId;
@@ -534,6 +544,7 @@ class SimpleSAML_Metadata_SAMLParser {
$ret = array();
$ret['entityid'] = $this->entityId;
+ $ret['entityDescriptor'] = $this->entityDescriptor;
/* Find SP information which supports the SAML 2.0 protocol. */
@@ -601,6 +612,7 @@ class SimpleSAML_Metadata_SAMLParser {
$ret = array();
$ret['entityid'] = $this->entityId;
+ $ret['entityDescriptor'] = $this->entityDescriptor;
$ret['name'] = $this->entityId;