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 8FDEB200B7D for ; Sat, 10 Sep 2016 16:41:13 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 8EB18160AA5; Sat, 10 Sep 2016 14:41:13 +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 BB11F160AD2 for ; Sat, 10 Sep 2016 16:41:12 +0200 (CEST) Received: (qmail 97768 invoked by uid 500); 10 Sep 2016 14:41:11 -0000 Mailing-List: contact commits-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list commits@cxf.apache.org Received: (qmail 97110 invoked by uid 99); 10 Sep 2016 14:41:11 -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; Sat, 10 Sep 2016 14:41:11 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 6BD7CE08B8; Sat, 10 Sep 2016 14:41:10 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: reta@apache.org To: commits@cxf.apache.org Date: Sat, 10 Sep 2016 14:41:14 -0000 Message-Id: <2a4487d6eca84db2be0e132374ad8507@git.apache.org> In-Reply-To: <2379b058510a4065acefc49ed97152b0@git.apache.org> References: <2379b058510a4065acefc49ed97152b0@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [06/37] cxf git commit: CXF-7039 - JAX-RS Security SAML web SSO consumer service can not validate SAML response behind reverse proxy archived-at: Sat, 10 Sep 2016 14:41:13 -0000 CXF-7039 - JAX-RS Security SAML web SSO consumer service can not validate SAML response behind reverse proxy Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/9247aad0 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/9247aad0 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/9247aad0 Branch: refs/heads/master-jaxrs-2.1 Commit: 9247aad0cf49619fe207559c9e4e60f1e0150e0d Parents: e1fe28c Author: Colm O hEigeartaigh Authored: Tue Sep 6 11:03:55 2016 +0100 Committer: Colm O hEigeartaigh Committed: Tue Sep 6 11:03:55 2016 +0100 ---------------------------------------------------------------------- .../AbstractRequestAssertionConsumerHandler.java | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cxf/blob/9247aad0/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/AbstractRequestAssertionConsumerHandler.java ---------------------------------------------------------------------- diff --git a/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/AbstractRequestAssertionConsumerHandler.java b/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/AbstractRequestAssertionConsumerHandler.java index 0e801f3..7486313 100644 --- a/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/AbstractRequestAssertionConsumerHandler.java +++ b/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/AbstractRequestAssertionConsumerHandler.java @@ -72,6 +72,7 @@ public abstract class AbstractRequestAssertionConsumerHandler extends AbstractSS private MessageContext messageContext; private String applicationURL; private boolean parseApplicationURLFromRelayState; + private String assertionConsumerServiceAddress; @Context public void setMessageContext(MessageContext mc) { @@ -334,8 +335,11 @@ public abstract class AbstractRequestAssertionConsumerHandler extends AbstractSS ) { try { SAMLSSOResponseValidator ssoResponseValidator = new SAMLSSOResponseValidator(); - ssoResponseValidator.setAssertionConsumerURL( - messageContext.getUriInfo().getAbsolutePath().toString()); + String racsAddress = assertionConsumerServiceAddress; + if (racsAddress == null) { + racsAddress = messageContext.getUriInfo().getAbsolutePath().toString(); + } + ssoResponseValidator.setAssertionConsumerURL(racsAddress); ssoResponseValidator.setClientAddress( messageContext.getHttpServletRequest().getRemoteAddr()); @@ -402,4 +406,12 @@ public abstract class AbstractRequestAssertionConsumerHandler extends AbstractSS this.parseApplicationURLFromRelayState = parseApplicationURLFromRelayState; } + public String getAssertionConsumerServiceAddress() { + return assertionConsumerServiceAddress; + } + + public void setAssertionConsumerServiceAddress(String assertionConsumerServiceAddress) { + this.assertionConsumerServiceAddress = assertionConsumerServiceAddress; + } + }