Revision: 1737
Author: olavmrk
Date: Tue Sep  1 23:45:48 2009
Log: Handle missing SP metadata in iframe logout.
http://code.google.com/p/simplesamlphp/source/detail?r=1737

Modified:
  /trunk/www/saml2/idp/SingleLogoutServiceiFrame.php

=======================================
--- /trunk/www/saml2/idp/SingleLogoutServiceiFrame.php  Fri Aug 14 04:07:44  
2009
+++ /trunk/www/saml2/idp/SingleLogoutServiceiFrame.php  Tue Sep  1 23:45:48  
2009
@@ -123,7 +123,17 @@
                // add a command to the response to assign the innerHTML 
attribute of
                // the element with id="SomeElementId" to whatever the new 
content is

-               $spmetadata = $metadata->getMetaData($spentityid, 
'saml20-sp-remote');
+               try {
+                       $spmetadata = $metadata->getMetaData($spentityid, 
'saml20-sp-remote');
+               } catch (Exception $e) {
+                       /*
+                        * For some reason, the metadata for this SP is no 
longer available.  
Most
+                        * likely it was deleted from the IdP while the user 
had a session to  
it.
+                        * In any case - skip this SP.
+                        */
+                       continue;
+               }
+
                $name = array_key_exists('name', $spmetadata) ? 
$spmetadata['name'] :  
$spentityid;

                $spname = is_array($name) ? $t->getTranslation($name) : $name;
@@ -265,7 +275,17 @@
                $nameId = $session->getNameID();
        }

-       $spMetadata =  
$metadata->getMetaDataConfig($spentityid, 'saml20-sp-remote');
+       try {
+               $spMetadata =  
$metadata->getMetaDataConfig($spentityid, 'saml20-sp-remote');
+       } catch (Exception $e) {
+               /*
+                * For some reason, the metadata for this SP is no longer 
available. Most
+                * likely it was deleted from the IdP while the user had a 
session to it.
+                * In any case - skip this SP.
+                */
+               continue;
+       }
+
        $name = $spMetadata->getValue('name', $spentityid);

        try {

--~--~---------~--~----~------------~-------~--~----~
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