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 83884EEF0 for ; Wed, 20 Feb 2013 11:33:09 +0000 (UTC) Received: (qmail 79287 invoked by uid 500); 20 Feb 2013 11:33:08 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 79189 invoked by uid 500); 20 Feb 2013 11:33:08 -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 79148 invoked by uid 99); 20 Feb 2013 11:33:07 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 20 Feb 2013 11:33:07 +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; Wed, 20 Feb 2013 11:33:05 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 1896523889D7; Wed, 20 Feb 2013 11:32:47 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1448093 - in /cxf/branches/2.6.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security: policy/interceptors/IssuedTokenInterceptorProvider.java trust/AbstractSTSClient.java Date: Wed, 20 Feb 2013 11:32:46 -0000 To: commits@cxf.apache.org From: coheigea@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20130220113247.1896523889D7@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: coheigea Date: Wed Feb 20 11:32:46 2013 New Revision: 1448093 URL: http://svn.apache.org/r1448093 Log: Merged revisions 1448080 via git cherry-pick from https://svn.apache.org/repos/asf/cxf/branches/2.7.x-fixes ........ r1448080 | coheigea | 2013-02-20 11:14:09 +0000 (Wed, 20 Feb 2013) | 10 lines Merged revisions 1448077 via git cherry-pick from https://svn.apache.org/repos/asf/cxf/trunk ........ r1448077 | coheigea | 2013-02-20 11:09:16 +0000 (Wed, 20 Feb 2013) | 2 lines [CXF-4841] - STSClient AppliesTo is not working correctly in certain circumstances ........ ........ Modified: cxf/branches/2.6.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/IssuedTokenInterceptorProvider.java cxf/branches/2.6.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/AbstractSTSClient.java Modified: cxf/branches/2.6.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/IssuedTokenInterceptorProvider.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/IssuedTokenInterceptorProvider.java?rev=1448093&r1=1448092&r2=1448093&view=diff ============================================================================== --- cxf/branches/2.6.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/IssuedTokenInterceptorProvider.java (original) +++ cxf/branches/2.6.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/IssuedTokenInterceptorProvider.java Wed Feb 20 11:32:46 2013 @@ -343,12 +343,10 @@ public class IssuedTokenInterceptorProvi client.setTrust(getTrust10(aim)); client.setTrust(getTrust13(aim)); client.setTemplate(itok.getRstTemplate()); - if (maps == null) { - return client.requestSecurityToken(); - } else { + if (maps != null && maps.getNamespaceURI() != null) { client.setAddressingNamespace(maps.getNamespaceURI()); - return client.requestSecurityToken(appliesTo); } + return client.requestSecurityToken(appliesTo); } private SecurityToken renewToken( Modified: cxf/branches/2.6.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/AbstractSTSClient.java URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/AbstractSTSClient.java?rev=1448093&r1=1448092&r2=1448093&view=diff ============================================================================== --- cxf/branches/2.6.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/AbstractSTSClient.java (original) +++ cxf/branches/2.6.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/AbstractSTSClient.java Wed Feb 20 11:32:46 2013 @@ -155,7 +155,7 @@ public abstract class AbstractSTSClient protected Element claims; protected AlgorithmSuite algorithmSuite; protected String namespace = STSUtils.WST_NS_05_12; - protected String addressingNamespace; + protected String addressingNamespace = "http://www.w3.org/2005/08/addressing"; protected Object onBehalfOf; protected boolean enableAppliesTo = true; @@ -974,10 +974,6 @@ public abstract class AbstractSTSClient tokentype = namespace + "/RSTR/Status"; } - if (addressingNamespace == null) { - addressingNamespace = "http://www.w3.org/2005/08/addressing"; - } - Policy validatePolicy = new Policy(); ExactlyOne one = new ExactlyOne(); validatePolicy.addPolicyComponent(one); @@ -1028,10 +1024,6 @@ public abstract class AbstractSTSClient protected STSResponse cancel(SecurityToken token) throws Exception { createClient(); - if (addressingNamespace == null) { - addressingNamespace = "http://www.w3.org/2005/08/addressing"; - } - client.getRequestContext().clear(); client.getRequestContext().putAll(ctx); client.getRequestContext().put(SecurityConstants.TOKEN, token); @@ -1067,13 +1059,19 @@ public abstract class AbstractSTSClient SignedEncryptedParts parts = new SignedEncryptedParts(true); parts.setOptional(true); parts.setBody(true); - parts.addHeader(new Header("To", addressingNamespace)); - parts.addHeader(new Header("From", addressingNamespace)); - parts.addHeader(new Header("FaultTo", addressingNamespace)); - parts.addHeader(new Header("ReplyTo", addressingNamespace)); - parts.addHeader(new Header("Action", addressingNamespace)); - parts.addHeader(new Header("MessageID", addressingNamespace)); - parts.addHeader(new Header("RelatesTo", addressingNamespace)); + + String addrNamespace = addressingNamespace; + if (addrNamespace == null) { + addrNamespace = "http://www.w3.org/2005/08/addressing"; + } + + parts.addHeader(new Header("To", addrNamespace)); + parts.addHeader(new Header("From", addrNamespace)); + parts.addHeader(new Header("FaultTo", addrNamespace)); + parts.addHeader(new Header("ReplyTo", addrNamespace)); + parts.addHeader(new Header("Action", addrNamespace)); + parts.addHeader(new Header("MessageID", addrNamespace)); + parts.addHeader(new Header("RelatesTo", addrNamespace)); all.addPolicyComponent(parts); client.getRequestContext().put(PolicyConstants.POLICY_OVERRIDE, cancelPolicy);