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 14:47:24 UTC

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

Author: coheigea
Date: Fri Oct 18 12:47:24 2013
New Revision: 1533424

URL: http://svn.apache.org/r1533424
Log:
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.7.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/STSInvoker.java

Modified: cxf/branches/2.7.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.7.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/STSInvoker.java?rev=1533424&r1=1533423&r2=1533424&view=diff
==============================================================================
--- cxf/branches/2.7.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/STSInvoker.java (original)
+++ cxf/branches/2.7.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/STSInvoker.java Fri Oct 18 12:47:24 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);