You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@syncope.apache.org by il...@apache.org on 2017/04/13 13:54:03 UTC

[1/2] syncope git commit: [SYNCOPE-1061] Better check

Repository: syncope
Updated Branches:
  refs/heads/2_0_X b70280327 -> ad8e197b2
  refs/heads/master 4a221fe8b -> e38b4c63b


[SYNCOPE-1061] Better check


Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/ad8e197b
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/ad8e197b
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/ad8e197b

Branch: refs/heads/2_0_X
Commit: ad8e197b255f78a4147019942abe5dac71b2f46f
Parents: b702803
Author: Francesco Chicchiricc� <il...@apache.org>
Authored: Thu Apr 13 15:53:41 2017 +0200
Committer: Francesco Chicchiricc� <il...@apache.org>
Committed: Thu Apr 13 15:53:41 2017 +0200

----------------------------------------------------------------------
 .../syncope/ext/saml2lsp/agent/AbstractSAML2SPServlet.java  | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/syncope/blob/ad8e197b/ext/saml2sp/agent/src/main/java/org/apache/syncope/ext/saml2lsp/agent/AbstractSAML2SPServlet.java
----------------------------------------------------------------------
diff --git a/ext/saml2sp/agent/src/main/java/org/apache/syncope/ext/saml2lsp/agent/AbstractSAML2SPServlet.java b/ext/saml2sp/agent/src/main/java/org/apache/syncope/ext/saml2lsp/agent/AbstractSAML2SPServlet.java
index bd295e3..d84bcd7 100644
--- a/ext/saml2sp/agent/src/main/java/org/apache/syncope/ext/saml2lsp/agent/AbstractSAML2SPServlet.java
+++ b/ext/saml2sp/agent/src/main/java/org/apache/syncope/ext/saml2lsp/agent/AbstractSAML2SPServlet.java
@@ -28,6 +28,7 @@ import javax.ws.rs.core.HttpHeaders;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.MultivaluedMap;
 import javax.ws.rs.core.UriBuilder;
+import org.apache.commons.lang3.StringUtils;
 import org.apache.cxf.helpers.IOUtils;
 import org.apache.cxf.jaxrs.utils.JAXRSUtils;
 import org.apache.syncope.common.lib.SSOConstants;
@@ -79,9 +80,11 @@ public abstract class AbstractSAML2SPServlet extends HttpServlet {
         String strForm = IOUtils.toString(response);
         MultivaluedMap<String, String> params = JAXRSUtils.getStructuredParams(strForm, "&", false, false);
 
-        String samlResponse = URLDecoder.decode(
-                params.getFirst(SSOConstants.SAML_RESPONSE), StandardCharsets.UTF_8.name());
-        LOG.debug("Received SAML Response: {}", samlResponse);
+        String samlResponse = params.getFirst(SSOConstants.SAML_RESPONSE);
+        if (StringUtils.isNotBlank(samlResponse)) {
+            samlResponse = URLDecoder.decode(samlResponse, StandardCharsets.UTF_8.name());
+            LOG.debug("Received SAML Response: {}", samlResponse);
+        }
 
         String relayState = params.getFirst(SSOConstants.RELAY_STATE);
         LOG.debug("Received Relay State: {}", relayState);


[2/2] syncope git commit: [SYNCOPE-1061] Better check

Posted by il...@apache.org.
[SYNCOPE-1061] Better check


Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/e38b4c63
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/e38b4c63
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/e38b4c63

Branch: refs/heads/master
Commit: e38b4c63baee4ce383f4009e3573639910d147dd
Parents: 4a221fe
Author: Francesco Chicchiricc� <il...@apache.org>
Authored: Thu Apr 13 15:53:41 2017 +0200
Committer: Francesco Chicchiricc� <il...@apache.org>
Committed: Thu Apr 13 15:53:55 2017 +0200

----------------------------------------------------------------------
 .../syncope/ext/saml2lsp/agent/AbstractSAML2SPServlet.java  | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/syncope/blob/e38b4c63/ext/saml2sp/agent/src/main/java/org/apache/syncope/ext/saml2lsp/agent/AbstractSAML2SPServlet.java
----------------------------------------------------------------------
diff --git a/ext/saml2sp/agent/src/main/java/org/apache/syncope/ext/saml2lsp/agent/AbstractSAML2SPServlet.java b/ext/saml2sp/agent/src/main/java/org/apache/syncope/ext/saml2lsp/agent/AbstractSAML2SPServlet.java
index bd295e3..d84bcd7 100644
--- a/ext/saml2sp/agent/src/main/java/org/apache/syncope/ext/saml2lsp/agent/AbstractSAML2SPServlet.java
+++ b/ext/saml2sp/agent/src/main/java/org/apache/syncope/ext/saml2lsp/agent/AbstractSAML2SPServlet.java
@@ -28,6 +28,7 @@ import javax.ws.rs.core.HttpHeaders;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.MultivaluedMap;
 import javax.ws.rs.core.UriBuilder;
+import org.apache.commons.lang3.StringUtils;
 import org.apache.cxf.helpers.IOUtils;
 import org.apache.cxf.jaxrs.utils.JAXRSUtils;
 import org.apache.syncope.common.lib.SSOConstants;
@@ -79,9 +80,11 @@ public abstract class AbstractSAML2SPServlet extends HttpServlet {
         String strForm = IOUtils.toString(response);
         MultivaluedMap<String, String> params = JAXRSUtils.getStructuredParams(strForm, "&", false, false);
 
-        String samlResponse = URLDecoder.decode(
-                params.getFirst(SSOConstants.SAML_RESPONSE), StandardCharsets.UTF_8.name());
-        LOG.debug("Received SAML Response: {}", samlResponse);
+        String samlResponse = params.getFirst(SSOConstants.SAML_RESPONSE);
+        if (StringUtils.isNotBlank(samlResponse)) {
+            samlResponse = URLDecoder.decode(samlResponse, StandardCharsets.UTF_8.name());
+            LOG.debug("Received SAML Response: {}", samlResponse);
+        }
 
         String relayState = params.getFirst(SSOConstants.RELAY_STATE);
         LOG.debug("Received Relay State: {}", relayState);