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 2014/10/14 16:38:04 UTC

[2/3] git commit: [CXF-6051] - "Support sp13:Nonce + sp13:Created in the UsernameTokenInterceptor"

[CXF-6051] - "Support sp13:Nonce + sp13:Created in the UsernameTokenInterceptor"

Conflicts:
	systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/ut/DoubleItUt.wsdl


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/789dbabc
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/789dbabc
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/789dbabc

Branch: refs/heads/2.7.x-fixes
Commit: 789dbabc9f9126549ce84d7e847c0e3f357478ab
Parents: 1e3a0ac
Author: Colm O hEigeartaigh <co...@apache.org>
Authored: Tue Oct 14 15:07:35 2014 +0100
Committer: Colm O hEigeartaigh <co...@apache.org>
Committed: Tue Oct 14 15:29:04 2014 +0100

----------------------------------------------------------------------
 .../wss4j/UsernameTokenInterceptor.java         |  7 +++++++
 .../apache/cxf/systest/ws/ut/DoubleItUt.wsdl    | 20 ++++++++++++++++++++
 2 files changed, 27 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/789dbabc/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/UsernameTokenInterceptor.java
----------------------------------------------------------------------
diff --git a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/UsernameTokenInterceptor.java b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/UsernameTokenInterceptor.java
index 739544f..d829f3a 100644
--- a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/UsernameTokenInterceptor.java
+++ b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/UsernameTokenInterceptor.java
@@ -352,6 +352,13 @@ public class UsernameTokenInterceptor extends AbstractTokenInterceptor {
                     utBuilder.setPasswordType(WSConstants.PASSWORD_TEXT);
                 }
                 
+                if (token.isCreated()) {
+                    utBuilder.addCreated();
+                }
+                if (token.isNonce()) {
+                    utBuilder.addNonce();
+                }
+                
                 utBuilder.setUserInfo(userName, password);
                 return utBuilder;
             } else {

http://git-wip-us.apache.org/repos/asf/cxf/blob/789dbabc/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/ut/DoubleItUt.wsdl
----------------------------------------------------------------------
diff --git a/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/ut/DoubleItUt.wsdl b/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/ut/DoubleItUt.wsdl
index 8300bf2..d07e72d 100644
--- a/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/ut/DoubleItUt.wsdl
+++ b/systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/ut/DoubleItUt.wsdl
@@ -308,7 +308,27 @@
             </wsp:All>
         </wsp:ExactlyOne>
     </wsp:Policy>
+<<<<<<< HEAD
     
+=======
+    <wsp:Policy wsu:Id="DoubleItPlaintextSupportingPolicy">
+        <wsp:ExactlyOne>
+            <wsp:All>
+                <sp:SupportingTokens>
+                    <wsp:Policy>
+                        <sp:UsernameToken sp:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/AlwaysToRecipient">
+                            <wsp:Policy>
+                                <sp:WssUsernameToken10/>
+                                <sp13:Created/>
+                                <sp13:Nonce/>
+                            </wsp:Policy>
+                        </sp:UsernameToken>
+                    </wsp:Policy>
+                </sp:SupportingTokens>
+            </wsp:All>
+        </wsp:ExactlyOne>
+    </wsp:Policy>
+>>>>>>> df6ca4d... [CXF-6051] - "Support sp13:Nonce + sp13:Created in the UsernameTokenInterceptor"
     <wsp:Policy wsu:Id="DoubleItHashedPolicy">
         <wsp:ExactlyOne>
             <wsp:All>