cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject [2/3] cxf git commit: Also store the Subject in the RECV_RESULTS for the UsernameTokenInterceptor
Date Mon, 23 Jan 2017 17:32:05 GMT
Also store the Subject in the RECV_RESULTS for the UsernameTokenInterceptor


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

Branch: refs/heads/3.1.x-fixes
Commit: 6c9a7606799831743c7aa8d86857648e15855bf4
Parents: c049eec
Author: Colm O hEigeartaigh <coheigea@apache.org>
Authored: Mon Jan 23 15:54:36 2017 +0000
Committer: Colm O hEigeartaigh <coheigea@apache.org>
Committed: Mon Jan 23 17:29:45 2017 +0000

----------------------------------------------------------------------
 .../cxf/ws/security/wss4j/UsernameTokenInterceptor.java  | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/6c9a7606/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 f1cd30c..80b38e2 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
@@ -136,7 +136,7 @@ public class UsernameTokenInterceptor extends AbstractTokenInterceptor
{
                     }
                     
                     if (principal instanceof UsernameTokenPrincipal) {
-                        storeResults((UsernameTokenPrincipal)principal, message);
+                        storeResults((UsernameTokenPrincipal)principal, subject, message);
                     }
                 } catch (WSSecurityException ex) {
                     throw new Fault(ex);
@@ -168,13 +168,18 @@ public class UsernameTokenInterceptor extends AbstractTokenInterceptor
{
         return context;
     }
     
-    private void storeResults(UsernameTokenPrincipal principal, SoapMessage message) {
+    private void storeResults(UsernameTokenPrincipal principal, Subject subject, SoapMessage
message) {
         List<WSSecurityEngineResult> v = new ArrayList<>();
         int action = WSConstants.UT;
         if (principal.getPassword() == null) {
             action = WSConstants.UT_NOPASSWORD;
         }
-        v.add(0, new WSSecurityEngineResult(action, principal, null, null, null));
+        
+        WSSecurityEngineResult result = new WSSecurityEngineResult(action, principal, null,
null, null);
+        if (subject != null) {
+            result.put(WSSecurityEngineResult.TAG_SUBJECT, subject);
+        }
+        v.add(0, result);
         List<WSHandlerResult> results = CastUtils.cast((List<?>)message
                                                   .get(WSHandlerConstants.RECV_RESULTS));
         if (results == null) {


Mime
View raw message