cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject svn commit: r1162810 - in /cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security: SecurityConstants.java trust/STSTokenValidator.java wss4j/WSS4JInInterceptor.java
Date Mon, 29 Aug 2011 13:58:56 GMT
Author: coheigea
Date: Mon Aug 29 13:58:56 2011
New Revision: 1162810

URL: http://svn.apache.org/viewvc?rev=1162810&view=rev
Log:
Add the ability to have a custom Validator implementation for a SecurityContextToken

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=1162810&r1=1162809&r2=1162810&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
Mon Aug 29 13:58:56 2011
@@ -37,6 +37,7 @@ public final class SecurityConstants {
     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 SCT_TOKEN_VALIDATOR = "ws-security.sct.validator";
     
     public static final String CALLBACK_HANDLER = "ws-security.callback-handler";
     public static final String SAML_CALLBACK_HANDLER = "ws-security.saml-callback-handler";
@@ -124,7 +125,7 @@ public final class SecurityConstants {
             SAML1_TOKEN_VALIDATOR, SAML2_TOKEN_VALIDATOR, TIMESTAMP_TOKEN_VALIDATOR,
             SIGNATURE_TOKEN_VALIDATOR, IS_BSP_COMPLIANT, TIMESTAMP_FUTURE_TTL,
             BST_TOKEN_VALIDATOR, SAML_CALLBACK_HANDLER, STS_TOKEN_ON_BEHALF_OF,
-            KERBEROS_CLIENT
+            KERBEROS_CLIENT, SCT_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=1162810&r1=1162809&r2=1162810&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
Mon Aug 29 13:58:56 2011
@@ -81,6 +81,9 @@ public class STSTokenValidator implement
             } else if (credential.getBinarySecurityToken() != null) {
                 tokenElement = credential.getBinarySecurityToken().getElement();
                 hash = credential.getBinarySecurityToken().hashCode();
+            } else if (credential.getSecurityContextToken() != null) {
+                tokenElement = credential.getSecurityContextToken().getElement();
+                hash = credential.getSecurityContextToken().hashCode();
             }
             token.setToken(tokenElement);
             

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=1162810&r1=1162809&r2=1162810&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
Mon Aug 29 13:58:56 2011
@@ -666,6 +666,9 @@ public class WSS4JInInterceptor extends 
                 key = SecurityConstants.TIMESTAMP_TOKEN_VALIDATOR;
             } else if (WSSecurityEngine.BINARY_TOKEN.equals(qName)) {
                 key = SecurityConstants.BST_TOKEN_VALIDATOR;
+            } else if (WSSecurityEngine.SECURITY_CONTEXT_TOKEN_05_02.equals(qName)
+                || WSSecurityEngine.SECURITY_CONTEXT_TOKEN_05_12.equals(qName)) {
+                key = SecurityConstants.SCT_TOKEN_VALIDATOR;
             }
             if (key != null) {
                 Object o = ((SoapMessage)this.getMsgContext()).getContextualProperty(key);



Mime
View raw message