Skip to content

Commit

Permalink
[project @ Django demo server: display information about PAPE request]
Browse files Browse the repository at this point in the history
  • Loading branch information
tailor committed Oct 13, 2008
1 parent 241f2bd commit f2852a4
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
3 changes: 3 additions & 0 deletions examples/djopenid/server/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
21 changes: 21 additions & 0 deletions examples/djopenid/templates/server/pape_request_info.html
Original file line number Diff line number Diff line change
@@ -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 %}
4 changes: 4 additions & 0 deletions examples/djopenid/templates/server/trust.html
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Expand All @@ -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 }} -->
Expand Down

0 comments on commit f2852a4

Please sign in to comment.