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

SimpleSAML_Metadata_SAMLParser: Add ArtifactResolutionService endpoint to metadata.

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@1751 44740490-163a-0410-bde0-09ae8108e29a
parent a5695c34
No related branches found
No related tags found
No related merge requests found
......@@ -40,6 +40,11 @@ class SimpleSAML_Metadata_SAMLParser {
*/
const SAML_1X_POST_BINDING = 'urn:oasis:names:tc:SAML:1.0:profiles:browser-post';
/**
* This is the SAML 1.0 SOAP binding.
*/
const SAML_1X_SOAP_BINDING = 'urn:oasis:names:tc:SAML:1.0:bindings:SOAP-binding';
/**
* This is the binding used for HTTP-POST in SAML 2.0.
......@@ -542,6 +547,12 @@ class SimpleSAML_Metadata_SAMLParser {
$ret['SingleSignOnService'] = $sso['Location'];
}
/* Find the ArtifactResolutionService endpoint. */
$artifactResolutionService = $this->getDefaultEndpoint($idp['ArtifactResolutionService'], array(self::SAML_1X_SOAP_BINDING));
if ($artifactResolutionService !== NULL) {
$ret['ArtifactResolutionService'] = $artifactResolutionService['Location'];
}
/* Add certificate to metadata. Only the first valid certificate will be added. */
$ret['certFingerprint'] = array();
foreach($idp['keys'] as $key) {
......@@ -717,6 +728,12 @@ class SimpleSAML_Metadata_SAMLParser {
}
/* Find the ArtifactResolutionService endpoint. */
$artifactResolutionService = $this->getDefaultEndpoint($idp['ArtifactResolutionService'], array(SAML2_Const::BINDING_SOAP));
if ($artifactResolutionService !== NULL) {
$ret['ArtifactResolutionService'] = $artifactResolutionService['Location'];
}
/* Add certificate to metadata. Only the first valid certificate will be added. */
$ret['certFingerprint'] = array();
......@@ -788,6 +805,14 @@ class SimpleSAML_Metadata_SAMLParser {
$sd['SingleLogoutService'][] = self::parseSingleLogoutService($child);
}
/* Find all ArtifactResolutionService elements. */
$sd['ArtifactResolutionService'] = array();
$acs = SimpleSAML_Utilities::getDOMChildren($element, 'ArtifactResolutionService', '@md');
foreach($acs as $child) {
$sd['ArtifactResolutionService'][] = self::parseArtifactResolutionService($child);
}
/* Process NameIDFormat elements. */
$sd['nameIDFormats'] = array();
$nif = SimpleSAML_Utilities::getDOMChildren($element, 'NameIDFormat', '@md');
......@@ -1049,6 +1074,19 @@ class SimpleSAML_Metadata_SAMLParser {
}
/**
* This function parses ArtifactResolutionService elements.
*
* @param $element The element which should be parsed.
* @return Associative array with the data we have extracted from the ArtifactResolutionService element.
*/
private static function parseArtifactResolutionService($element) {
assert('$element instanceof DOMElement');
return self::parseGenericEndpoint($element, TRUE);
}
/**
* This function parses NameIDFormat elements.
*
......
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