diff --git a/virtualenv/pffedportal/base/views.py b/virtualenv/pffedportal/base/views.py index a6ab93d..7b7ac33 100644 --- a/virtualenv/pffedportal/base/views.py +++ b/virtualenv/pffedportal/base/views.py @@ -75,6 +75,7 @@ def index(request): 'pfsense_session': pfsense_session, 'prefered_idp': request.session.get('prefered_idp', ''), 'mailform': mailform, + 'https_hostname': settings.HTTPS_HOSTNAME, }, context_instance=RequestContext(request)) # store prefered_idp in a cookie with a ten days ttl @@ -104,6 +105,7 @@ def login(request): {'default_idp': default_idp, 'idp_providers': get_idp_list_sorted(), 'mailform': mailform, + 'https_hostname': settings.HTTPS_HOSTNAME, }, context_instance=RequestContext(request)) diff --git a/virtualenv/pffedportal/media/simple-disco-store/README.txt b/virtualenv/pffedportal/media/simple-disco-store/README.txt new file mode 100644 index 0000000..8eae468 --- /dev/null +++ b/virtualenv/pffedportal/media/simple-disco-store/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/virtualenv/pffedportal/media/simple-disco-store/debug.js b/virtualenv/pffedportal/media/simple-disco-store/debug.js new file mode 100644 index 0000000..446de9b --- /dev/null +++ b/virtualenv/pffedportal/media/simple-disco-store/debug.js @@ -0,0 +1,6 @@ +debug = false; +function debug_alert(msg) { + if (debug) { + alert(msg); + } +} diff --git a/virtualenv/pffedportal/media/simple-disco-store/discoquery.js b/virtualenv/pffedportal/media/simple-disco-store/discoquery.js new file mode 100644 index 0000000..2964609 --- /dev/null +++ b/virtualenv/pffedportal/media/simple-disco-store/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 = $(''); + var query_url = url; + if (url.indexOf('?') == -1) { + query_url = query_url + '?'; + } else { + query_url = query_url + '&'; + } + var param = {}; + param[C_ENTITY_ID] = entity_id; + param[C_RETURN] = response_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); + $(iframe).remove(); + }; + window.disco_callback = disco_callback; + } else { + window.disco_callback = undefined; + } + $(iframe).appendTo('body'); + } + $.disco_set = function (entity_id, idp_entity_id, url, response_url, callback) { + var iframe = $(''); + var query_url = url; + if (url.indexOf('?') == -1) { + query_url = query_url + '?'; + } else { + query_url = query_url + '&'; + } + var param = {}; + param[C_ENTITY_ID] = entity_id; + param[C_RETURN] = response_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); + $(iframe).remove(); + }; + window.disco_callback = disco_callback; + } else { + window.disco_callback = undefined; + } + $(iframe).appendTo('body'); + } +})(); diff --git a/virtualenv/pffedportal/media/simple-disco-store/doc/discoreadwrite.txt b/virtualenv/pffedportal/media/simple-disco-store/doc/discoreadwrite.txt new file mode 100644 index 0000000..8fce17f --- /dev/null +++ b/virtualenv/pffedportal/media/simple-disco-store/doc/discoreadwrite.txt @@ -0,0 +1,828 @@ + + + + + +
+ + +
+ 1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32 +33 +34 +35 +36 +37 +38 +39 +40 ++ |
+
+
|
+
Headers
++# This is an <h1> tag +## This is an <h2> tag +###### This is an <h6> tag+
Text styles
++*This text will be italic* +_This will also be italic_ +**This text will be bold** +__This will also be bold__ + +*You **can** combine them* ++
Unordered
++* Item 1 +* Item 2 + * Item 2a + * Item 2b+
Ordered
++1. Item 1 +2. Item 2 +3. Item 3 + * Item 3a + * Item 3b+
Images
++![GitHub Logo](/images/logo.png) +Format: ![Alt Text](url) ++
Links
++http://github.com - automatic! +[GitHub](http://github.com)+
Blockquotes
++As Kanye West said: + +> We're living the future so +> the present is our past. ++
Syntax highlighting with GFM
++```javascript +function fancyAlert(arg) { + if(arg) { + $.facebox({div:'#foo'}) + } +} +```+
Or, indent your code 4 spaces
++Here is a Python code example +without syntax highlighting: + + def foo: + if not bar: + return true+
Inline code for comments
++I think you should use an +`<addr>` element here instead.+
t |