Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[project @ Django demo server: display information about PAPE request]

  • Loading branch information...
commit f2852a4d918de2cacc237cacc5b0f62d293f54ed 1 parent 241f2bd
tailor authored
View
3  examples/djopenid/server/views.py
@@ -194,12 +194,15 @@ def showDecidePage(request, openid_request):
except HTTPFetchingError, err:
trust_root_valid = "Unreachable"
+ pape_request = pape.Request.fromOpenIDRequest(openid_request)
+
return direct_to_template(
request,
'server/trust.html',
{'trust_root': trust_root,
'trust_handler_url':getViewURL(request, processTrustResult),
'trust_root_valid': trust_root_valid,
+ 'pape_request': pape_request,
})
def processTrustResult(request):
View
21 examples/djopenid/templates/server/pape_request_info.html
@@ -0,0 +1,21 @@
+{% if pape_request %}
+ {% if pape_request.preferred_auth_policies %}
+ The relying party requested the following PAPE policies be in effect:
+
+ <ul>
+ {% for uri in pape_request.preferred_auth_policies %}
+ <li>{{ uri }}</li>
+ {% endfor %}
+ </ul>
+ {% endif %}
+
+ {% if pape_request.preferred_auth_level_types %}
+ The relying party requested the following authentication level types:
+
+ <ul>
+ {% for uri in pape_request.preferred_auth_level_types %}
+ <li>{{ uri }}</li>
+ {% endfor %}
+ </ul>
+ {% endif %}
+{% endif %}
View
4 examples/djopenid/templates/server/trust.html
@@ -6,6 +6,8 @@
<!-- Trust root has been validated by OpenID 2 mechanism. -->
<p>The site <tt>{{ trust_root|escape }}</tt> has requested verification
of your OpenID.</p>
+
+ {% include "server/pape_request_info.html" %}
{% endifequal %}
{% ifequal trust_root_valid "Invalid" %}
<div class="error">
@@ -29,6 +31,8 @@
extra caution in deciding whether to release information to this party,
and ask <tt>{{ trust_root|escape }}</tt> to implement relying party
verification for your future transactions.</p>
+
+ {% include "server/pape_request_info.html" %}
{% endifequal %}
<!-- trust_root_valid is {{ trust_root_valid }} -->
Please sign in to comment.
Something went wrong with that request. Please try again.