commit 645279036d04aab7e350edbbed70196145c9448d Author: Benjamin Dauvergne Date: Wed Jul 11 15:06:24 2012 +0200 first commit diff --git a/README.txt b/README.txt new file mode 100644 index 0000000..8eae468 --- /dev/null +++ b/README.txt @@ -0,0 +1,28 @@ +Simple IdP Discovery Store and Query +==================================== + +How to use +---------- + +Copy this code in your web app. + +Place the response.html somewhere, let's say at http://sp.example.com/response.html. + +Add this: + + + + + + +And make the linked files accessible. + +Call this to get the globally stored preference: + + $.disco_query("http://sp.example.com/metadata", "http://disco.example.com/store", "http://sp.example.com/response.html", function (entity_id, auth) { + // do something with it + }); + +Call this to store your preference: + + $.disco_query("http://sp.example.com/metadata", "http://chosen_idp.example.com/metadata", "http://disco.example.com/store", "http://sp.example.com/response.html"); diff --git a/debug.js b/debug.js new file mode 100644 index 0000000..446de9b --- /dev/null +++ b/debug.js @@ -0,0 +1,6 @@ +debug = false; +function debug_alert(msg) { + if (debug) { + alert(msg); + } +} diff --git a/discoquery.js b/discoquery.js new file mode 100644 index 0000000..2964609 --- /dev/null +++ b/discoquery.js @@ -0,0 +1,62 @@ +(function () { + var C_ENTITY_ID = "entityID"; + var C_RETURN = "return"; + var C_POLICY = "policy"; + var C_RETURNIDPARAM = "returnIDParam"; + var C_IS_PASSIVE = "isPassive"; + var C_IDP_ENTITY_ID = "IdPentityID"; + var COOKIE_TIMEOUT_DAYS = 730; + + $.disco_query = function (entity_id, url, response_url, callback) { + var iframe = $('