[java-shib-idp2 COMMIT] /branches/REL_2/src/main/java/edu/internet2/middleware/shibboleth/idp/profile/saml2/SLOProfil...

noreply at shibboleth.net noreply at shibboleth.net
Mon Nov 26 14:40:23 EST 2012


Author: scantor
Date: Mon Nov 26 14:40:22 2012
New Revision: 3125

URL: http://svn.shibboleth.net/view/java-shib-idp2?rev=3125&view=rev
Log:
Avoid terminating session during error processing.

Modified:
    branches/REL_2/src/main/java/edu/internet2/middleware/shibboleth/idp/profile/saml2/SLOProfileHandler.java

Modified: branches/REL_2/src/main/java/edu/internet2/middleware/shibboleth/idp/profile/saml2/SLOProfileHandler.java
URL: http://svn.shibboleth.net/view/java-shib-idp2/branches/REL_2/src/main/java/edu/internet2/middleware/shibboleth/idp/profile/saml2/SLOProfileHandler.java?rev=3125&r1=3124&r2=3125&view=diff
==============================================================================
--- branches/REL_2/src/main/java/edu/internet2/middleware/shibboleth/idp/profile/saml2/SLOProfileHandler.java (original)
+++ branches/REL_2/src/main/java/edu/internet2/middleware/shibboleth/idp/profile/saml2/SLOProfileHandler.java Mon Nov 26 14:40:22 2012
@@ -179,12 +179,12 @@
         }
 
         if (activeSession != null) {
-            if (activeSession != indirect) {
+            if (indirect == null || !DatatypeHelper.safeEquals(activeSession.getSessionID(), indirect.getSessionID())) {
                 log.info("Invalidating session identified from client request: {}", activeSession.getSessionID());
                 destroySession(activeSession);
             }
         } else {
-            log.info("No session to invalidate from client request or LogoutRequest.");
+            log.info("No session to invalidate from client request.");
         }
 
         response.setContentType("text/html");
@@ -266,6 +266,7 @@
                 status = buildStatus(StatusCode.REQUESTER_URI, StatusCode.UNKNOWN_PRINCIPAL_URI, null);
             } else if (!indexedSession.getServicesInformation().keySet().contains(requestContext.getInboundMessageIssuer())) {
                 // Session matched, but it's not associated with the requesting SP.
+                indexedSession = null;
                 log.warn("Requesting entity is not a participant in the referenced session.");
                 status = buildStatus(StatusCode.REQUESTER_URI, StatusCode.UNKNOWN_PRINCIPAL_URI, null);
             } else if (getInboundBinding().equals(SAMLConstants.SAML2_SOAP11_BINDING_URI)) {
@@ -289,6 +290,7 @@
                     }
                 } else {
                     // Session found, but it's not the same as the active session.
+                    indexedSession = null;
                     log.warn("LogoutRequest referenced a session other than the client's current one.");
                     status = buildStatus(StatusCode.REQUESTER_URI, StatusCode.UNKNOWN_PRINCIPAL_URI, null);
                 }



More information about the commits mailing list