diff --git a/lib/SimpleSAML/Metadata/SAMLParser.php b/lib/SimpleSAML/Metadata/SAMLParser.php index df0ec9110936adead6d4a4dc333e26ca2ce5c09e..352e1523fc57205cf824f7ab64cf1e6685349413 100644 --- a/lib/SimpleSAML/Metadata/SAMLParser.php +++ b/lib/SimpleSAML/Metadata/SAMLParser.php @@ -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. *