cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject svn commit: r1458230 - /cxf/branches/wss4j2.0-port/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/SamlTokenInterceptor.java
Date Tue, 19 Mar 2013 11:26:20 GMT
Author: coheigea
Date: Tue Mar 19 11:26:19 2013
New Revision: 1458230

URL: http://svn.apache.org/r1458230
Log:
Fixing build

Modified:
    cxf/branches/wss4j2.0-port/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/SamlTokenInterceptor.java

Modified: cxf/branches/wss4j2.0-port/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/SamlTokenInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/branches/wss4j2.0-port/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/SamlTokenInterceptor.java?rev=1458230&r1=1458229&r2=1458230&view=diff
==============================================================================
--- cxf/branches/wss4j2.0-port/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/SamlTokenInterceptor.java
(original)
+++ cxf/branches/wss4j2.0-port/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/SamlTokenInterceptor.java
Tue Mar 19 11:26:19 2013
@@ -114,19 +114,14 @@ public class SamlTokenInterceptor extend
                             }
                         }
                         assertTokens(message, SPConstants.SAML_TOKEN, signed);
-                        // TODO revisit
-                        AssertionInfoMap aim = message.get(AssertionInfoMap.class);
-                        assertPolicy(aim, "WssSamlV11Token10");
-                        assertPolicy(aim, "WssSamlV11Token11");
-                        assertPolicy(aim, "WssSamlV20Token11");
                         
                         // Check version against policy
                         AssertionInfoMap aim = message.get(AssertionInfoMap.class);
-                        for (AssertionInfo ai : aim.getAssertionInfo(SP12Constants.SAML_TOKEN))
{
+                        for (AssertionInfo ai : getAllAssertionsByLocalname(aim, SPConstants.SAML_TOKEN))
{
                             SamlToken samlToken = (SamlToken)ai.getAssertion();
                             for (WSSecurityEngineResult result : samlResults) {
-                                AssertionWrapper assertionWrapper = 
-                                    (AssertionWrapper)result.get(WSSecurityEngineResult.TAG_SAML_ASSERTION);
+                                SamlAssertionWrapper assertionWrapper = 
+                                    (SamlAssertionWrapper)result.get(WSSecurityEngineResult.TAG_SAML_ASSERTION);
 
                                 if (!checkVersion(samlToken, assertionWrapper)) {
                                     ai.setNotAsserted("Wrong SAML Version");
@@ -371,12 +366,13 @@ public class SamlTokenInterceptor extend
     /**
      * Check the policy version against the received assertion
      */
-    private boolean checkVersion(SamlToken samlToken, AssertionWrapper assertionWrapper)
{
-        if ((samlToken.isUseSamlVersion11Profile10()
-            || samlToken.isUseSamlVersion11Profile11())
+    private boolean checkVersion(SamlToken samlToken, SamlAssertionWrapper assertionWrapper)
{
+        SamlTokenType tokenType = samlToken.getSamlTokenType();
+        if ((tokenType == SamlTokenType.WssSamlV11Token10 
+            || tokenType == SamlTokenType.WssSamlV11Token11)
             && assertionWrapper.getSamlVersion() != SAMLVersion.VERSION_11) {
             return false;
-        } else if (samlToken.isUseSamlVersion20Profile11()
+        } else if (tokenType == SamlTokenType.WssSamlV20Token11
             && assertionWrapper.getSamlVersion() != SAMLVersion.VERSION_20) {
             return false;
         }



Mime
View raw message