Skip to content

Commit

Permalink
ufal/shibboleth-redirect-from-login (#433)
Browse files Browse the repository at this point in the history
* Send redirectUrl param to the IdP in the target url

* The code is updated to be more readable.
  • Loading branch information
milanmajchrak authored Jan 3, 2024
1 parent 6be9911 commit 4e6c290
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/aai/aai.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@
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."
};
this.setup = function(options) {
var targetUrl = '';
var opts = jQuery.extend({}, this.defaults, options),
defaultCallback = function(e) {
window.location = opts.host + '/Shibboleth.sso/Login?SAMLDS=1&target=' + opts.target + '&entityID=' + window.encodeURIComponent(e.entityID);
targetUrl = opts.target + '?redirectUrl=' + window.location.href;
window.location = opts.host + '/Shibboleth.sso/Login?SAMLDS=1&target=' + targetUrl + '&entityID=' + window.encodeURIComponent(e.entityID);
};
//console.log(opts);
if(!opts.target){
Expand All @@ -33,7 +35,7 @@
opts.ourEntityID,
opts.responseUrl,
[ ],
opts.host + '/Shibboleth.sso/Login?SAMLDS=1&target='+opts.target+'&entityID=');
opts.host + '/Shibboleth.sso/Login?SAMLDS=1&target=' + targetUrl + '&entityID=');
djc.discoPath = window.location.origin + (namespace === '' ? namespace : '/' + namespace) + "/assets/";
djc.metadata = [opts.metadataFeed];
djc.subtitle = "Login via Your home institution (e.g. university)";
Expand Down

0 comments on commit 4e6c290

Please sign in to comment.