Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id A0323200C5A for ; Tue, 18 Apr 2017 10:53:50 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 9DC1D160BBC; Tue, 18 Apr 2017 08:53:50 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id F19C0160BB3 for ; Tue, 18 Apr 2017 10:53:49 +0200 (CEST) Received: (qmail 29386 invoked by uid 500); 18 Apr 2017 08:53:49 -0000 Mailing-List: contact commits-help@syncope.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@syncope.apache.org Delivered-To: mailing list commits@syncope.apache.org Received: (qmail 28548 invoked by uid 99); 18 Apr 2017 08:53:47 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 18 Apr 2017 08:53:47 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id EDDF0DFDAC; Tue, 18 Apr 2017 08:53:46 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: ilgrosso@apache.org To: commits@syncope.apache.org Date: Tue, 18 Apr 2017 08:54:07 -0000 Message-Id: <156e3847401a4f63b36569c866847cd4@git.apache.org> In-Reply-To: <51f09940abbd448c8cad1c143c189cf1@git.apache.org> References: <51f09940abbd448c8cad1c143c189cf1@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [22/50] [abbrv] syncope git commit: [SYNCOPE-1061] Better check archived-at: Tue, 18 Apr 2017 08:53:50 -0000 [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/SYNCOPE-808 Commit: ad8e197b255f78a4147019942abe5dac71b2f46f Parents: b702803 Author: Francesco Chicchiriccò Authored: Thu Apr 13 15:53:41 2017 +0200 Committer: Francesco Chicchiriccò 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 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);