You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by co...@apache.org on 2013/10/18 16:54:14 UTC

svn commit: r1533475 - /cxf/branches/2.6.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/STSInvoker.java

Author: coheigea
Date: Fri Oct 18 14:54:14 2013
New Revision: 1533475

URL: http://svn.apache.org/r1533475
Log:
Merged revisions 1533424 via  git cherry-pick from
https://svn.apache.org/repos/asf/cxf/branches/2.7.x-fixes

........
  r1533424 | coheigea | 2013-10-18 13:47:24 +0100 (Fri, 18 Oct 2013) | 6 lines

  Fixed an error when trying to cancel a token

  Conflicts:
  	rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/STSInvoker.java

........

Modified:
    cxf/branches/2.6.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/STSInvoker.java

Modified: cxf/branches/2.6.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/STSInvoker.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/STSInvoker.java?rev=1533475&r1=1533474&r2=1533475&view=diff
==============================================================================
--- cxf/branches/2.6.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/STSInvoker.java (original)
+++ cxf/branches/2.6.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/STSInvoker.java Fri Oct 18 14:54:14 2013
@@ -29,7 +29,6 @@ import javax.xml.transform.dom.DOMSource
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 import org.w3c.dom.Node;
-
 import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.endpoint.Endpoint;
 import org.apache.cxf.helpers.DOMUtils;
@@ -49,6 +48,7 @@ import org.apache.ws.security.WSSecurity
 import org.apache.ws.security.conversation.ConversationException;
 import org.apache.ws.security.conversation.dkalgo.P_SHA1;
 import org.apache.ws.security.message.token.Reference;
+import org.apache.ws.security.message.token.SecurityContextToken;
 import org.apache.ws.security.message.token.SecurityTokenReference;
 import org.apache.ws.security.util.Base64;
 import org.apache.ws.security.util.WSSecurityUtil;
@@ -169,8 +169,15 @@ abstract class STSInvoker implements Inv
     }
 
     private SecurityToken findCancelToken(Exchange exchange, Element el) throws WSSecurityException {
-        SecurityTokenReference ref = new SecurityTokenReference(DOMUtils.getFirstElement(el));
-        String uri = ref.getReference().getURI();
+        Element childElement = DOMUtils.getFirstElement(el);
+        String uri = "";
+        if ("SecurityContextToken".equals(childElement.getLocalName())) {
+            SecurityContextToken sct = new SecurityContextToken(childElement);
+            uri = sct.getIdentifier();
+        } else {
+            SecurityTokenReference ref = new SecurityTokenReference(childElement);
+            uri = ref.getReference().getURI();
+        }
         TokenStore store = (TokenStore)exchange.get(Endpoint.class).getEndpointInfo()
                 .getProperty(TokenStore.class.getName());
         return store.getToken(uri);