From 90de301d61cdaa0a2c6f338c12f08ed391320934 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Romain=20D=C3=A9nari=C3=A9?= Date: Mon, 18 Sep 2023 17:20:10 +0200 Subject: [PATCH] fix: allow to redirect on initialUri when using SAML - EXO-66292 - meeds-io/meeds#1104 Before this fix, with SAML, user is not redirected on initialUri if he is not connected to IDP after successul authentication This modification ensure to add the initialURI parameter in the next request after the /sso request --- .../org/gatein/sso/agent/filter/LoginRedirectFilter.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/agent/src/main/java/org/gatein/sso/agent/filter/LoginRedirectFilter.java b/agent/src/main/java/org/gatein/sso/agent/filter/LoginRedirectFilter.java index 2fe9c3807..ef0563dc8 100644 --- a/agent/src/main/java/org/gatein/sso/agent/filter/LoginRedirectFilter.java +++ b/agent/src/main/java/org/gatein/sso/agent/filter/LoginRedirectFilter.java @@ -70,7 +70,11 @@ public void doFilter(ServletRequest request, ServletResponse response, */ protected String getLoginRedirectURL(HttpServletRequest httpRequest) { - return this.loginUrl; + String url = this.loginUrl; + if (httpRequest.getQueryString() != null) { + url = url + "?" + httpRequest.getQueryString(); + } + return url; } }