Skip to content
Snippets Groups Projects
Commit 6daf0ffe authored by Andreas Åkre Solberg's avatar Andreas Åkre Solberg
Browse files

Fix bug with IdP Discovery script

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@2795 44740490-163a-0410-bde0-09ae8108e29a
parent 028b02d1
No related branches found
No related tags found
No related merge requests found
......@@ -54,6 +54,10 @@ var IdPDiscovery = function() {
"returnTo": function(e) {
// console.log('ReturnTo');
// console.log(e);
// return;
var returnTo = query['return'] || null;
var returnIDParam = query.returnIDParam || 'entityID';
if(!returnTo) {
......@@ -65,12 +69,15 @@ var IdPDiscovery = function() {
var returnToHost = this.getHostname(returnTo);
for (var i = 0; i < returnURLs.length; i++) {
if (returnURLs[i] == returnToHost) allowed = true;
for (var i = 0; i < this.returnURLs.length; i++) {
if (this.returnURLs[i] == returnToHost) allowed = true;
}
if (!allowed) {
DiscoJuice.Utils.log('Access denied for return parameter [' + returnToHost + ']');
DiscoJuice.Utils.log('Allowed hosts');
DiscoJuice.Utils.log(this.returnURLs);
return;
}
}
......@@ -79,10 +86,10 @@ var IdPDiscovery = function() {
returnTo += '&auth=' + e.auth;
}
if (!e.entityid) {
if (!e.entityID) {
window.location = returnTo;
} else {
window.location = returnTo + '&' + returnIDParam + '=' + escape(e.entityid);
window.location = returnTo + '&' + returnIDParam + '=' + escape(e.entityID);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment