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

SAMLBuilder: Handle multiple ACS endpoints.

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@1844 44740490-163a-0410-bde0-09ae8108e29a
parent 1010ce40
No related branches found
No related tags found
No related merge requests found
......@@ -263,22 +263,27 @@ class SimpleSAML_Metadata_SAMLBuilder {
$e->appendChild($t);
}
$acsIndex = 0;
if (array_key_exists('AssertionConsumerService', $metadata)) {
$index = 0;
if (array_key_exists('AssertionConsumerService.artifact', $metadata)) {
foreach (SimpleSAML_Utilities::arrayize($metadata['AssertionConsumerService']) as $acs) {
$t = $this->createElement('AssertionConsumerService');
$t->setAttribute('index', (string)$index);
$t->setAttribute('index', (string)$acsIndex);
$t->setAttribute('Binding', 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST');
$t->setAttribute('Location', $acs);
$e->appendChild($t);
$acsIndex += 1;
}
}
if (array_key_exists('AssertionConsumerService.artifact', $metadata)) {
foreach (SimpleSAML_Utilities::arrayize($metadata['AssertionConsumerService.artifact']) as $acs) {
$t = $this->createElement('AssertionConsumerService');
$t->setAttribute('index', (string)$acsIndex);
$t->setAttribute('Binding', 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Artifact');
$t->setAttribute('Location', $metadata['AssertionConsumerService.artifact']);
$t->setAttribute('Location', $acs);
$e->appendChild($t);
$index++;
$acsIndex += 1;
}
$t = $this->createElement('AssertionConsumerService');
$t->setAttribute('index', (string)$index);
$t->setAttribute('Binding', 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST');
$t->setAttribute('Location', $metadata['AssertionConsumerService']);
$e->appendChild($t);
}
......@@ -425,23 +430,27 @@ class SimpleSAML_Metadata_SAMLBuilder {
$e->appendChild($t);
}
$acsIndex = 0;
if (array_key_exists('AssertionConsumerService', $metadata)) {
$index = 0;
if (array_key_exists('AssertionConsumerService.artifact', $metadata)) {
foreach (SimpleSAML_Utilities::arrayize($metadata['AssertionConsumerService']) as $acs) {
$t = $this->createElement('AssertionConsumerService');
$t->setAttribute('index', (string)$index);
$t->setAttribute('index', (string)$acsIndex);
$t->setAttribute('Binding', 'urn:oasis:names:tc:SAML:1.0:profiles:browser-post');
$t->setAttribute('Location', $acs);
$e->appendChild($t);
$acsIndex += 1;
}
}
if (array_key_exists('AssertionConsumerService.artifact', $metadata)) {
foreach (SimpleSAML_Utilities::arrayize($metadata['AssertionConsumerService.artifact']) as $acs) {
$t = $this->createElement('AssertionConsumerService');
$t->setAttribute('index', (string)$acsIndex);
$t->setAttribute('Binding', 'urn:oasis:names:tc:SAML:1.0:profiles:artifact-01');
$t->setAttribute('Location', $metadata['AssertionConsumerService.artifact']);
$t->setAttribute('Location', $acs);
$e->appendChild($t);
$index++;
$acsIndex += 1;
}
$t = $this->createElement('AssertionConsumerService');
$t->setAttribute('index', (string)$index);
$t->setAttribute('Binding', 'urn:oasis:names:tc:SAML:1.0:profiles:browser-post');
$t->setAttribute('Location', $metadata['AssertionConsumerService']);
$e->appendChild($t);
}
$this->entityDescriptor->appendChild($e);
......
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