cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject svn commit: r1562862 - in /cxf/branches/2.7.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security: policy/interceptors/SecureConversationInInterceptor.java tokenstore/SecurityToken.java
Date Thu, 30 Jan 2014 15:49:11 GMT
Author: coheigea
Date: Thu Jan 30 15:49:11 2014
New Revision: 1562862

URL: http://svn.apache.org/r1562862
Log:
[CXF-5533] - Store a reference to a Bootstrap SecurityToken in SecureConveration


Conflicts:
	rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/SecureConversationInInterceptor.java

Modified:
    cxf/branches/2.7.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/SecureConversationInInterceptor.java
    cxf/branches/2.7.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/tokenstore/SecurityToken.java

Modified: cxf/branches/2.7.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/SecureConversationInInterceptor.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/SecureConversationInInterceptor.java?rev=1562862&r1=1562861&r2=1562862&view=diff
==============================================================================
--- cxf/branches/2.7.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/SecureConversationInInterceptor.java
(original)
+++ cxf/branches/2.7.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/SecureConversationInInterceptor.java
Thu Jan 30 15:49:11 2014
@@ -21,10 +21,10 @@ package org.apache.cxf.ws.security.polic
 
 import java.util.Collection;
 import java.util.Date;
+import java.util.Properties;
 import java.util.logging.Logger;
 
 import org.w3c.dom.Element;
-
 import org.apache.cxf.binding.soap.SoapBindingConstants;
 import org.apache.cxf.binding.soap.SoapMessage;
 import org.apache.cxf.binding.soap.interceptor.SoapActionInInterceptor;
@@ -291,6 +291,14 @@ class SecureConversationInInterceptor ex
                 token.setSecurityContext(sc);
             }
             
+            // Get Bootstrap Token
+            SecurityToken bootstrapToken = getBootstrapToken(exchange.getInMessage());
+            if (bootstrapToken != null) {
+                Properties properties = new Properties();
+                properties.put(SecurityToken.BOOTSTRAP_TOKEN_ID, bootstrapToken.getId());
+                token.setProperties(properties);
+            }
+            
             ((TokenStore)exchange.get(Endpoint.class).getEndpointInfo()
                     .getProperty(TokenStore.class.getName())).add(token);
             
@@ -301,6 +309,16 @@ class SecureConversationInInterceptor ex
             }
         }
 
+        private SecurityToken getBootstrapToken(Message message) {
+            SecurityToken st = (SecurityToken)message.getContextualProperty(SecurityConstants.TOKEN);
+            if (st == null) {
+                String id = (String)message.getContextualProperty(SecurityConstants.TOKEN_ID);
+                if (id != null) {
+                    st = NegotiationUtils.getTokenStore(message).getToken(id);
+                }
+            }
+            return st;
+        }
     }
     
     
@@ -414,4 +432,4 @@ class SecureConversationInInterceptor ex
     
 
     
-}
\ No newline at end of file
+}

Modified: cxf/branches/2.7.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/tokenstore/SecurityToken.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/tokenstore/SecurityToken.java?rev=1562862&r1=1562861&r2=1562862&view=diff
==============================================================================
--- cxf/branches/2.7.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/tokenstore/SecurityToken.java
(original)
+++ cxf/branches/2.7.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/tokenstore/SecurityToken.java
Thu Jan 30 15:49:11 2014
@@ -44,6 +44,11 @@ import org.apache.ws.security.util.XmlSc
  */
 public class SecurityToken implements Serializable {
     
+    /**
+     * This tag holds an ID of a Bootstrap SecurityToken stored in the TokenStore 
+     */
+    public static final String BOOTSTRAP_TOKEN_ID = "bootstrap_security_token_id";
+    
     private static final long serialVersionUID = 3820740387121650613L;
 
     /**



Mime
View raw message