From 9c76530fd33e45fad0f5575cfa8370f472ac5dbc Mon Sep 17 00:00:00 2001 From: Alex Ivanov Date: Wed, 14 Jun 2017 16:21:12 -0400 Subject: [PATCH 1/2] 1551-Make Use of RedirectPage Logic --- src/main/webapp/resources/js/shib/idpselect_config.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/main/webapp/resources/js/shib/idpselect_config.js b/src/main/webapp/resources/js/shib/idpselect_config.js index e2cafe3eaca..13a6f69d703 100644 --- a/src/main/webapp/resources/js/shib/idpselect_config.js +++ b/src/main/webapp/resources/js/shib/idpselect_config.js @@ -13,6 +13,11 @@ function IdPSelectUIParms() { // this.defaultReturn = null; // If non null, then the default place to send users who are not // Approaching via the Discovery Protocol for example //this.defaultReturn = "https://example.org/Shibboleth.sso/DS?SAMLDS=1&target=https://example.org/secure"; + + if (window.location.href.search("redirectPage") > 0){ + redirectStr = urlParam('redirectPage'); + shibRedirectPage = encodeURIComponent("?redirectPage=" + redirectStr); + } this.defaultReturn = window.location.protocol + "//" + window.location.hostname + "/Shibboleth.sso/Login?SAMLDS=1&target=" + window.location.protocol + "//" + window.location.hostname + "/shib.xhtml" + shibRedirectPage; this.defaultReturnIDParam = null; @@ -139,3 +144,8 @@ function IdPSelectUIParms() { this.maxHeight = 69; this.bestRatio = Math.log(80 / 60); } + +function urlParam(name) { + var results = new RegExp('[\?&]' + name + '=([^&#]*)').exec(window.location.href); + return results[1] || 0; +} From f7e1b7185f200c25f4eb73c44c2abcb59168a401 Mon Sep 17 00:00:00 2001 From: oscardssmith Date: Mon, 19 Jun 2017 10:24:49 -0400 Subject: [PATCH 2/2] Comment explaining stuff --- src/main/webapp/resources/js/shib/idpselect_config.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/webapp/resources/js/shib/idpselect_config.js b/src/main/webapp/resources/js/shib/idpselect_config.js index 13a6f69d703..84e90c5a25f 100644 --- a/src/main/webapp/resources/js/shib/idpselect_config.js +++ b/src/main/webapp/resources/js/shib/idpselect_config.js @@ -147,5 +147,6 @@ function IdPSelectUIParms() { function urlParam(name) { var results = new RegExp('[\?&]' + name + '=([^&#]*)').exec(window.location.href); + //Returns the value for the specified parameter, or 0 if the parameter is not found in the url string return results[1] || 0; }