add a store parameter to response.html and to callbacks, in order to notify which store responded when launching many requests
This commit is contained in:
parent
5c9354ed56
commit
70826f489a
|
@ -5,6 +5,7 @@
|
|||
var C_RETURNIDPARAM = "returnIDParam";
|
||||
var C_IS_PASSIVE = "isPassive";
|
||||
var C_IDP_ENTITY_ID = "IdPentityID";
|
||||
var C_STORE = "store";
|
||||
var COOKIE_TIMEOUT_DAYS = 730;
|
||||
|
||||
$.disco_query = function (entity_id, url, response_url, callback) {
|
||||
|
@ -17,14 +18,14 @@
|
|||
}
|
||||
var param = {};
|
||||
param[C_ENTITY_ID] = entity_id;
|
||||
param[C_RETURN] = response_url;
|
||||
param[C_RETURN] = response_url + '?' + C_STORE + '=' + escape(url);
|
||||
param[C_IS_PASSIVE] = 'true';
|
||||
query_url = query_url + $.param(param);
|
||||
debug_alert('query_url '+query_url);
|
||||
iframe.attr('src', query_url);
|
||||
if (callback) {
|
||||
var disco_callback = function (entity_id, auth) {
|
||||
callback(entity_id, auth);
|
||||
var disco_callback = function (entity_id, store, auth) {
|
||||
callback(entity_id, store, auth);
|
||||
$(iframe).remove();
|
||||
};
|
||||
window.disco_callback = disco_callback;
|
||||
|
@ -43,14 +44,14 @@
|
|||
}
|
||||
var param = {};
|
||||
param[C_ENTITY_ID] = entity_id;
|
||||
param[C_RETURN] = response_url;
|
||||
param[C_RETURN] = response_url + '?' + C_STORE + '=' + escape(url);
|
||||
param[C_IDP_ENTITY_ID] = idp_entity_id;
|
||||
query_url = query_url + $.param(param);
|
||||
debug_alert('query_url '+query_url);
|
||||
iframe.attr('src', query_url);
|
||||
if (callback) {
|
||||
var disco_callback = function (entity_id, auth) {
|
||||
callback(entity_id, auth);
|
||||
var disco_callback = function (entity_id, store, auth) {
|
||||
callback(entity_id, store, auth);
|
||||
$(iframe).remove();
|
||||
};
|
||||
window.disco_callback = disco_callback;
|
||||
|
|
|
@ -11,13 +11,15 @@
|
|||
<script>
|
||||
var C_ENTITY_ID = "entityID";
|
||||
var C_AUTH = "auth";
|
||||
var C_STORE = "store";
|
||||
|
||||
var qs = $.parseQuerystring();
|
||||
var store = qs[C_STORE];
|
||||
var auth = qs[C_AUTH];
|
||||
var entity_id = qs[C_ENTITY_ID];
|
||||
debug_alert(window.location.search + ' received ' + entity_id + ' + auth ' + auth);
|
||||
if (entity_id && parent.disco_callback) {
|
||||
parent.disco_callback(entity_id, auth);
|
||||
parent.disco_callback(entity_id, store, auth);
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
|
14
test.html
14
test.html
|
@ -9,12 +9,18 @@
|
|||
<body>
|
||||
<script>
|
||||
function query() {
|
||||
$.disco_query("coucou", "./store.html", "./response.html", function (entity_id, auth) {
|
||||
alert("idp is " + entity_id); });
|
||||
$.disco_query("coucou", "./store.html", "./response.html",
|
||||
function (entity_id, store, auth) {
|
||||
alert("idp is " + entity_id + " said " + store);
|
||||
}
|
||||
);
|
||||
}
|
||||
function set() {
|
||||
$.disco_set("coucou", $('#idp').val(), "./store.html", "./response.html", function (entity_id, auth) {
|
||||
alert("idp has been set to " + entity_id); });
|
||||
$.disco_set("coucou", $('#idp').val(), "./store.html", "./response.html",
|
||||
function (entity_id, store, auth) {
|
||||
alert("idp has been set to " + entity_id + " on " + store);
|
||||
}
|
||||
);
|
||||
}
|
||||
</script>
|
||||
<div>
|
||||
|
|
Reference in New Issue