Revision: 1751
Author: olavmrk
Date: Wed Sep  9 23:32:22 2009
Log: SimpleSAML_Metadata_SAMLParser: Add ArtifactResolutionService endpoint  
to metadata.
http://code.google.com/p/simplesamlphp/source/detail?r=1751

Modified:
  /trunk/lib/SimpleSAML/Metadata/SAMLParser.php

=======================================
--- /trunk/lib/SimpleSAML/Metadata/SAMLParser.php       Wed Sep  9 23:32:13 2009
+++ /trunk/lib/SimpleSAML/Metadata/SAMLParser.php       Wed Sep  9 23:32:22 2009
@@ -40,6 +40,11 @@
         */
        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.
@@ -541,6 +546,12 @@
                } else {
                        $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();
@@ -717,6 +728,12 @@

                }

+               /* 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();
@@ -787,6 +804,14 @@
                foreach($sls as $child) {
                        $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();
@@ -1047,6 +1072,19 @@

                return self::parseGenericEndpoint($element, FALSE);
        }
+
+
+       /**
+        * 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);
+       }


        /**

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"simpleSAMLphp commits" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/simplesamlphp-commits?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to