This is an automated email from the ASF dual-hosted git repository.

coheigea pushed a commit to branch 1.4.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf-fediz.git

commit 13a4719973734a64fefc38bfa7f9fe38fa252dd9
Author: Colm O hEigeartaigh <cohei...@apache.org>
AuthorDate: Thu May 17 10:52:52 2018 +0100

    Enabled modified signature test for SAML SSO
---
 .../fediz/core/processor/SAMLProcessorImpl.java    |  2 +-
 .../cxf/fediz/integrationtests/AbstractTests.java  | 22 +++++++++++++++-------
 2 files changed, 16 insertions(+), 8 deletions(-)

diff --git 
a/plugins/core/src/main/java/org/apache/cxf/fediz/core/processor/SAMLProcessorImpl.java
 
b/plugins/core/src/main/java/org/apache/cxf/fediz/core/processor/SAMLProcessorImpl.java
index 4ae304d..374f659 100644
--- 
a/plugins/core/src/main/java/org/apache/cxf/fediz/core/processor/SAMLProcessorImpl.java
+++ 
b/plugins/core/src/main/java/org/apache/cxf/fediz/core/processor/SAMLProcessorImpl.java
@@ -134,7 +134,7 @@ public class SAMLProcessorImpl extends 
AbstractFedizProcessor {
             } else {
                 tokenStream = CompressionUtils.inflate(deflatedToken);
             }
-        } catch (DataFormatException ex) {
+        } catch (IllegalArgumentException | DataFormatException ex) {
             LOG.warn("Invalid data format", ex);
             throw new ProcessingException(TYPE.INVALID_REQUEST);
         } catch (Base64DecodingException e) {
diff --git 
a/systests/tests/src/test/java/org/apache/cxf/fediz/integrationtests/AbstractTests.java
 
b/systests/tests/src/test/java/org/apache/cxf/fediz/integrationtests/AbstractTests.java
index fba3cd6..7a85783 100644
--- 
a/systests/tests/src/test/java/org/apache/cxf/fediz/integrationtests/AbstractTests.java
+++ 
b/systests/tests/src/test/java/org/apache/cxf/fediz/integrationtests/AbstractTests.java
@@ -79,6 +79,14 @@ public abstract class AbstractTests {
         return "samlsigninresponseform";
     }
 
+    private String getTokenNameFromForm() {
+        if (isWSFederation()) {
+            return "wresult";
+        }
+
+        return "SAMLResponse";
+    }
+
     @Test
     public void testAlice() throws Exception {
         String url = "https://localhost:"; + getRpHttpsPort() + "/" + 
getServletContextName()
@@ -569,10 +577,6 @@ public abstract class AbstractTests {
     @Test
     public void testAliceModifiedSignature() throws Exception {
 
-        if (!isWSFederation()) {
-            return;
-        }
-
         String url = "https://localhost:"; + getRpHttpsPort() + "/" + 
getServletContextName()
             + "/secure/fedservlet";
         String user = "alice";
@@ -596,17 +600,21 @@ public abstract class AbstractTests {
         DomNodeList<DomElement> results = 
idpPage.getElementsByTagName("input");
 
         for (DomElement result : results) {
-            if ("wresult".equals(result.getAttributeNS(null, "name"))) {
+            if (getTokenNameFromForm().equals(result.getAttributeNS(null, 
"name"))) {
                 // Now modify the Signature
                 String value = result.getAttributeNS(null, "value");
-                value = value.replace("alice", "bob");
+                if (value.contains("alice")) {
+                    value = value.replace("alice", "bob");
+                } else {
+                    value += "H";
+                }
                 result.setAttributeNS(null, "value", value);
             }
         }
 
         // Invoke back on the RP
 
-        final HtmlForm form = idpPage.getFormByName("signinresponseform");
+        final HtmlForm form = idpPage.getFormByName(getLoginFormName());
         final HtmlSubmitInput button = form.getInputByName("_eventId_submit");
 
         try {

-- 
To stop receiving notification emails like this one, please contact
cohei...@apache.org.

Reply via email to