[java-identity-provider COMMIT] in /trunk: idp-conf/src/main/resources/system/views/logout/propagate.vm idp-saml-impl...

noreply at shibboleth.net noreply at shibboleth.net
Wed Nov 4 18:52:49 EST 2015


Author: scantor
Date: Wed Nov  4 18:52:49 2015
New Revision: 7936

URL: http://svn.shibboleth.net/view/java-identity-provider?rev=7936&view=rev
Log:
IDP-224 - Single Logout Implementation

Use a synthetic key to lookup SPSessions and modify actions to generate it.
Improve propagate Javascript to handle multiple sessions per RP with assoc. arrays.

Modified:
    trunk/idp-conf/src/main/resources/system/views/logout/propagate.vm
    trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/saml2/profile/impl/ProcessLogoutRequest.java
    trunk/idp-session-api/src/main/java/net/shibboleth/idp/session/context/LogoutContext.java
    trunk/idp-session-impl/src/main/java/net/shibboleth/idp/session/impl/PopulateLogoutPropagationContext.java
    trunk/idp-session-impl/src/main/java/net/shibboleth/idp/session/impl/ProcessLogout.java

Modified: trunk/idp-conf/src/main/resources/system/views/logout/propagate.vm
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-conf/src/main/resources/system/views/logout/propagate.vm?rev=7936&r1=7935&r2=7936&view=diff
==============================================================================
--- trunk/idp-conf/src/main/resources/system/views/logout/propagate.vm	(original)
+++ trunk/idp-conf/src/main/resources/system/views/logout/propagate.vm	Wed Nov  4 18:52:49 2015
@@ -7,6 +7,7 @@
 ## flowExecutionKey - the SWF execution key (this is built into the flowExecutionUrl)
 ## profileRequestContext - root of context tree
 ## logoutContext - context with SPSession details for logout operation
+## flowSelector - bean that maps an SPSession to a logout propagation flow
 ## multiRPContext - context with RelyingPartyContexts and possibly SP UI information from the metadata
 ## htmlEncoder - HTMLEncoder class
 ## urlEncoder - urlEncoder class
@@ -16,7 +17,12 @@
 ## environment - Spring Environment object for property resolution
 ## custom - arbitrary object injected by deployer
 ##
-
+## The <li> items are an enumeration of the relying parties among the sessions
+## and are identified by an encoding of the name of the relying party.
+##
+## The iframes are bound to a single session and are associated back to the <li>
+## element for the relying party of their session.
+##
 #if ($logoutContext and !$logoutContext.getSessionMap().isEmpty())
     <ol>
         #foreach ($sp in $logoutContext.getSessionMap().keySet())
@@ -33,18 +39,41 @@
     </ol>
     <script src="$request.getContextPath()/js/jquery-2.1.4.min.js"></script>
     <script>
-        function onLoad(src, target, sessionKey) {
+    <!--
+        function check_status() {
+            // Check every property of the object.
+            for (flag in this) {
+                if (!flag) {
+                    return false;
+                }
+            }
+            return true;
+        }
+
+        // Associative array keyed by SP name. Entries are an array keyed by session key.
+        var sessionTracker = new Object();
+        #foreach ($sp in $logoutContext.getSessionMap().keySet())
+            spTracker = new Object();
+            spTracker.status = check_status;
+            sessionTracker['result_$codecUtil.hex($sp.getBytes())'] = spTracker;
+        #end
+    
+        function onLoad(src, target, trackerId, sessionKey) {
             try {
                 var content = src.contents().text();
                 target.removeClass("success failure");
                 if (content && jQuery.parseJSON(content).result == "Success") {
-                    target.addClass("success");
-                    target.prop("title", "Successful logout")
+                    sessionTracker[trackerId]['_' + sessionKey] = true;
                 } else {
-                    target.addClass("failure");
-                    target.prop("title", "Failed logout")
+                    sessionTracker[trackerId]['_' + sessionKey] = true;
                 }
             } catch (e) {
+                sessionTracker[trackerId]['_' + sessionKey] = true;
+            }
+            if (sessionTracker[trackerId].status()) {
+                target.addClass("success");
+                target.prop("title", "Successful logout");
+            } else {
                 target.addClass("failure");
                 target.prop("title", "Failed logout")
             }
@@ -56,15 +85,14 @@
                 }
             }
         }
+    // -->
     </script>
-    #foreach ($sp in $logoutContext.getSessionMap().keySet())
-        #foreach ($session in $logoutContext.getSessions($sp))
-            #set ($skey = $session.getSPSessionKey())
-            #if ($flowSelector.apply($session))
-                <iframe id="sender_$codecUtil.hex($skey.getBytes())"
-                    src="$request.contextPath/profile/PropagateLogout?SessionKey=$urlEncoder.encode($skey)"
-                    style="display:none" onload="onLoad($(this), $('#result_$codecUtil.hex($sp.getBytes())'), '$skey')"></iframe>
-            #end
+    #foreach ($entry in $logoutContext.getKeyedSessionMap().entrySet())
+        #if ($flowSelector.apply($entry.getValue()))

[... 158 lines stripped ...]


More information about the commits mailing list