From 645279036d04aab7e350edbbed70196145c9448d Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Wed, 11 Jul 2012 15:06:24 +0200 Subject: [PATCH] first commit --- README.txt | 28 ++ debug.js | 6 + discoquery.js | 62 +++ doc/discoreadwrite.txt | 828 ++++++++++++++++++++++++++++++++ doc/sstc-saml-idp-discovery.pdf | Bin 0 -> 245180 bytes jquery-1.7.2.min.js | 4 + jquery.cookie-1.1.js | 61 +++ jquery.qs.js | 19 + response.html | 24 + store.html | 52 ++ test.html | 27 ++ 11 files changed, 1111 insertions(+) create mode 100644 README.txt create mode 100644 debug.js create mode 100644 discoquery.js create mode 100644 doc/discoreadwrite.txt create mode 100644 doc/sstc-saml-idp-discovery.pdf create mode 100755 jquery-1.7.2.min.js create mode 100644 jquery.cookie-1.1.js create mode 100644 jquery.qs.js create mode 100644 response.html create mode 100644 store.html create mode 100644 test.html 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 = $('