Skip to content

Commit 4e6c290

Browse files
ufal/shibboleth-redirect-from-login (DSpace#433)
* Send redirectUrl param to the IdP in the target url * The code is updated to be more readable.
1 parent 6be9911 commit 4e6c290

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/aai/aai.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,11 @@
1818
textHelpMore: "First check you are searching under the right country.\nIf your provider is not listed, please read <a href='https://lindat.mff.cuni.cz/how-do-i-sign-up' style='text-decoration: underline; font-weight: bold;'>these instructions</a> to obtain an account."
1919
};
2020
this.setup = function(options) {
21+
var targetUrl = '';
2122
var opts = jQuery.extend({}, this.defaults, options),
2223
defaultCallback = function(e) {
23-
window.location = opts.host + '/Shibboleth.sso/Login?SAMLDS=1&target=' + opts.target + '&entityID=' + window.encodeURIComponent(e.entityID);
24+
targetUrl = opts.target + '?redirectUrl=' + window.location.href;
25+
window.location = opts.host + '/Shibboleth.sso/Login?SAMLDS=1&target=' + targetUrl + '&entityID=' + window.encodeURIComponent(e.entityID);
2426
};
2527
//console.log(opts);
2628
if(!opts.target){
@@ -33,7 +35,7 @@
3335
opts.ourEntityID,
3436
opts.responseUrl,
3537
[ ],
36-
opts.host + '/Shibboleth.sso/Login?SAMLDS=1&target='+opts.target+'&entityID=');
38+
opts.host + '/Shibboleth.sso/Login?SAMLDS=1&target=' + targetUrl + '&entityID=');
3739
djc.discoPath = window.location.origin + (namespace === '' ? namespace : '/' + namespace) + "/assets/";
3840
djc.metadata = [opts.metadataFeed];
3941
djc.subtitle = "Login via Your home institution (e.g. university)";

0 commit comments

Comments
 (0)