Fixed remaining issues.

This commit is contained in:
Roland Hedberg 2013-12-20 12:58:35 +01:00
parent b631f65e44
commit cc71ab2fad
8 changed files with 27 additions and 22 deletions

View File

@ -21,11 +21,11 @@
</tr>
</table>
</form>
% if logo_url:
<img src="${logo_url}" alt="Client logo">
% if logo_uri:
<img src="${logo_uri}" alt="Client logo">
% endif
% if policy_url:
<a href="${policy_url}"><b>Client policy</b></a>
% if policy_uri:
<a href="${policy_uri}"><b>Client policy</b></a>
% endif
</div>

View File

@ -4,8 +4,8 @@
<div class="consent" class="block">
Allow access to ${relaying_party}<br>
Select the information you want to share with ${relaying_party}.
% if policy_url:
Please review the ${relaying_part} <a href="${policy_url}"><b>privacy policy</b></a>
% if policy_uri:
Please review the ${relaying_part} <a href="${policy_uri}"><b>privacy policy</b></a>
% endif
<form action="${action}" method="post" class="consent form">
@ -27,6 +27,6 @@
</table>
</form>
% if logo_url:
<img src="${logo_url}" alt="Client logo">
<img src="${logo_uri}" alt="Client logo">
% endif
</div>

View File

@ -22,10 +22,10 @@
</tr>
</table>
</form>
% if logo_url:
% if logo_uri:
<img src="${logo_uri}" alt="Client logo">
% endif
% if policy_url:
% if policy_uri:
<a href="${policy_uri}"><b>Client policy</b></a>
% endif
</div>

View File

@ -17,8 +17,8 @@ SERVICE = {
"pyoidcOICStatic": {
#{'client_secret':
# '1e1254a35bf2000dff6daaef35660a85f7f17b5a0d5192da7838dfb1',
# 'policy_url': '', 'redirect_uris': [('http://hashog.umdc.umu
# .se:8666/pyoidcOICStatic', None)], 'logo_url': '', 'client_id':
# 'policy_uri': '', 'redirect_uris': [('http://hashog.umdc.umu
# .se:8666/pyoidcOICStatic', None)], 'logo_uri': '', 'client_id':
# 'VJNL62bPdOnn'}
"opKey": "pyoidcOICStatic",
"client_id": "VJNL62bPdOnn",

View File

@ -38,7 +38,7 @@ class CDB(object):
def items(self):
return self.cdb.items()
def create(self, redirect_uris=None, policy_url="", logo_url=""):
def create(self, redirect_uris=None, policy_uri="", logo_uri=""):
if redirect_uris is None:
print 'Enter redirect_uris one at the time, end with a blank line: '
redirect_uris = []
@ -48,10 +48,10 @@ class CDB(object):
redirect_uris.append(redirect_uri)
else:
break
if not policy_url:
policy_url = raw_input("Enter policy_url or just return: ")
if not logo_url:
logo_url = raw_input("Enter logo_url or just return: ")
if not policy_uri:
policy_uri = raw_input("Enter policy_uri or just return: ")
if not logo_uri:
logo_uri = raw_input("Enter logo_uri or just return: ")
client_id = rndstr(12)
while client_id in self.cdb:
@ -63,8 +63,8 @@ class CDB(object):
"client_secret": client_secret,
"client_id": client_id,
"redirect_uris": pack_redirect_uri(redirect_uris),
"policy_url": policy_url,
"logo_url": logo_url,
"policy_uri": policy_uri,
"logo_uri": logo_uri,
}
return self.cdb[client_id]

View File

@ -424,7 +424,7 @@ class Provider(object):
authn_args = {"query": request}
cinfo = self.cdb[areq["client_id"]]
for attr in ["policy_url", "logo_url"]:
for attr in ["policy_uri", "logo_uri"]:
try:
authn_args[attr] = cinfo[attr]
except KeyError:

View File

@ -656,7 +656,11 @@ class Provider(AProvider):
# If redirect_uri was in the initial authorization request
# verify that the one given here is the correct one.
if "redirect_uri" in _info:
assert req["redirect_uri"] == _info["redirect_uri"]
try:
assert req["redirect_uri"] == _info["redirect_uri"]
except AssertionError:
return self._error(error="access_denied",
descr="redirect_uri mismatch")
_log_debug("All checks OK")
@ -1085,8 +1089,9 @@ class Provider(AProvider):
_rat = rndstr(32)
reg_enp = ""
for endp in self.endp:
if isinstance(endp, RegistrationEndpoint):
if endp == RegistrationEndpoint:
reg_enp = "%s%s" % (self.baseurl, endp.etype)
break
self.cdb[client_id] = {
"client_id": client_id,

View File

@ -184,7 +184,7 @@ class UsernamePasswordMako(UserAuthnMethod):
except KeyError:
argv["login"] = ""
for param in ["policy_url", "logo_url", "query"]:
for param in ["policy_uri", "logo_uri", "query"]:
try:
argv[param] = kwargs[param]
except KeyError: