diff --git a/src/main/webapp/resources/js/shib/idpselect_config.js b/src/main/webapp/resources/js/shib/idpselect_config.js index e2cafe3eaca..84e90c5a25f 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,9 @@ function IdPSelectUIParms() { this.maxHeight = 69; this.bestRatio = Math.log(80 / 60); } + +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; +}