cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject svn commit: r1087009 - in /cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security: SecurityConstants.java trust/STSTokenValidator.java wss4j/WSS4JInInterceptor.java
Date Wed, 30 Mar 2011 16:25:42 GMT
Author: coheigea
Date: Wed Mar 30 16:25:42 2011
New Revision: 1087009

URL: http://svn.apache.org/viewvc?rev=1087009&view=rev
Log:
Added the ability to configure a validator for BinarySecurityTokens

Modified:
    cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/SecurityConstants.java
    cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSTokenValidator.java
    cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JInInterceptor.java

Modified: cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/SecurityConstants.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/SecurityConstants.java?rev=1087009&r1=1087008&r2=1087009&view=diff
==============================================================================
--- cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/SecurityConstants.java
(original)
+++ cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/SecurityConstants.java
Wed Mar 30 16:25:42 2011
@@ -36,6 +36,7 @@ public final class SecurityConstants {
     public static final String SAML2_TOKEN_VALIDATOR = "ws-security.saml2.validator";
     public static final String TIMESTAMP_TOKEN_VALIDATOR = "ws-security.timestamp.validator";
     public static final String SIGNATURE_TOKEN_VALIDATOR = "ws-security.signature.validator";
+    public static final String BST_TOKEN_VALIDATOR = "ws-security.bst.validator";
     
     public static final String CALLBACK_HANDLER = "ws-security.callback-handler";
     
@@ -108,7 +109,8 @@ public final class SecurityConstants {
             STS_TOKEN_DO_CANCEL, TIMESTAMP_TTL, ALWAYS_ENCRYPT_UT,
             STS_TOKEN_ACT_AS, STS_TOKEN_USERNAME, STS_TOKEN_USE_CERT_FOR_KEYINFO,
             SAML1_TOKEN_VALIDATOR, SAML2_TOKEN_VALIDATOR, TIMESTAMP_TOKEN_VALIDATOR,
-            SIGNATURE_TOKEN_VALIDATOR, IS_BSP_COMPLIANT, TIMESTAMP_FUTURE_TTL
+            SIGNATURE_TOKEN_VALIDATOR, IS_BSP_COMPLIANT, TIMESTAMP_FUTURE_TTL,
+            BST_TOKEN_VALIDATOR
         }));
         ALL_PROPERTIES = Collections.unmodifiableSet(s);
     }

Modified: cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSTokenValidator.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSTokenValidator.java?rev=1087009&r1=1087008&r2=1087009&view=diff
==============================================================================
--- cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSTokenValidator.java
(original)
+++ cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSTokenValidator.java
Wed Mar 30 16:25:42 2011
@@ -64,6 +64,8 @@ public class STSTokenValidator implement
                 token.setToken(credential.getAssertion().getElement());
             } else if (credential.getUsernametoken() != null) {
                 token.setToken(credential.getUsernametoken().getElement());
+            } else if (credential.getBinarySecurityToken() != null) {
+                token.setToken(credential.getBinarySecurityToken().getElement());
             }
             
             STSClient c = STSUtils.getClient(m, "sts");

Modified: cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JInInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JInInterceptor.java?rev=1087009&r1=1087008&r2=1087009&view=diff
==============================================================================
--- cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JInInterceptor.java
(original)
+++ cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JInInterceptor.java
Wed Mar 30 16:25:42 2011
@@ -647,7 +647,9 @@ public class WSS4JInInterceptor extends 
                 key = SecurityConstants.SIGNATURE_TOKEN_VALIDATOR;
             } else if (WSSecurityEngine.TIMESTAMP.equals(qName)) {
                 key = SecurityConstants.TIMESTAMP_TOKEN_VALIDATOR;
-            } 
+            } else if (WSSecurityEngine.BINARY_TOKEN.equals(qName)) {
+                key = SecurityConstants.BST_TOKEN_VALIDATOR;
+            }
             if (key != null) {
                 Object o = ((SoapMessage)this.getMsgContext()).getContextualProperty(key);
                 try {



Mime
View raw message