Made it possible to accept a success Response without Attribute and AttributeValues.

This commit is contained in:
Roland Hedberg
2013-05-24 11:42:00 +02:00
parent b0848c108c
commit c4b33787dc
2 changed files with 10 additions and 5 deletions

View File

@@ -82,11 +82,16 @@ def delete_cookie(environ, name):
#noinspection PyUnusedLocal
def whoami(environ, start_response, user):
identity = environ["repoze.who.identity"]["user"]
if not identity:
nameid = environ["repoze.who.identity"]["login"]
ava = environ["repoze.who.identity"]["user"]
if not nameid:
return not_authn(environ, start_response)
response = ["<h2>Your identity are supposed to be</h2>"]
response.extend(dict_to_table(identity))
if ava:
response = ["<h2>Your identity are supposed to be</h2>"]
response.extend(dict_to_table(ava))
else:
response = ["<h2>No information about you was returned</h2>"]
response.extend("<a href='logout'>Logout</a>")
resp = Response(response)
return resp(environ, start_response)

View File

@@ -38,7 +38,7 @@ CONFIG = {
"contact_type": "technical",
},
],
#"xmlsec_binary":"/usr/local/bin/xmlsec1",
#"xmlsec_binary":"/opt/local/bin/xmlsec1",
"name_form": NAME_FORMAT_URI,
"logger": {
"rotating": {