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

Metadata parser - include original EntityDescriptor in metadata.

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@871 44740490-163a-0410-bde0-09ae8108e29a
parent bbfb2e9e
No related branches found
No related tags found
No related merge requests found
......@@ -110,6 +110,12 @@ class SimpleSAML_Metadata_SAMLParser {
private $validator = array();
/**
* The original EntityDescriptor element for this entity, as a base64 encoded string.
*/
private $entityDescriptor;
/**
* This is the constructor for the SAMLParser class.
*
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment