Return-Path: X-Original-To: apmail-cxf-commits-archive@www.apache.org Delivered-To: apmail-cxf-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9C4741092E for ; Fri, 18 Oct 2013 11:50:06 +0000 (UTC) Received: (qmail 77147 invoked by uid 500); 18 Oct 2013 11:50:06 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 77036 invoked by uid 500); 18 Oct 2013 11:50:05 -0000 Mailing-List: contact commits-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list commits@cxf.apache.org Received: (qmail 77028 invoked by uid 99); 18 Oct 2013 11:50:05 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 18 Oct 2013 11:50:05 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 18 Oct 2013 11:50:04 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id DD0682388999; Fri, 18 Oct 2013 11:49:43 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1533405 - /cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/STSInvoker.java Date: Fri, 18 Oct 2013 11:49:43 -0000 To: commits@cxf.apache.org From: coheigea@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20131018114943.DD0682388999@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: coheigea Date: Fri Oct 18 11:49:43 2013 New Revision: 1533405 URL: http://svn.apache.org/r1533405 Log: Fixed an error when trying to cancel a token Modified: cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/STSInvoker.java Modified: cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/STSInvoker.java URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/STSInvoker.java?rev=1533405&r1=1533404&r2=1533405&view=diff ============================================================================== --- cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/STSInvoker.java (original) +++ cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/STSInvoker.java Fri Oct 18 11:49:43 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; @@ -50,6 +49,7 @@ import org.apache.wss4j.common.ext.WSSec import org.apache.wss4j.dom.WSConstants; import org.apache.wss4j.dom.bsp.BSPEnforcer; import org.apache.wss4j.dom.message.token.Reference; +import org.apache.wss4j.dom.message.token.SecurityContextToken; import org.apache.wss4j.dom.message.token.SecurityTokenReference; import org.apache.wss4j.dom.util.WSSecurityUtil; import org.apache.wss4j.dom.util.XmlSchemaDateFormat; @@ -170,9 +170,16 @@ abstract class STSInvoker implements Inv } private SecurityToken findCancelToken(Exchange exchange, Element el) throws WSSecurityException { - SecurityTokenReference ref = - new SecurityTokenReference(DOMUtils.getFirstElement(el), new BSPEnforcer()); - 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, new BSPEnforcer()); + uri = ref.getReference().getURI(); + } TokenStore store = (TokenStore)exchange.get(Endpoint.class).getEndpointInfo() .getProperty(TokenStore.class.getName()); return store.getToken(uri);