Fixed remaining issues.
This commit is contained in:
parent
b631f65e44
commit
cc71ab2fad
|
@ -21,11 +21,11 @@
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</form>
|
</form>
|
||||||
% if logo_url:
|
% if logo_uri:
|
||||||
<img src="${logo_url}" alt="Client logo">
|
<img src="${logo_uri}" alt="Client logo">
|
||||||
% endif
|
% endif
|
||||||
% if policy_url:
|
% if policy_uri:
|
||||||
<a href="${policy_url}"><b>Client policy</b></a>
|
<a href="${policy_uri}"><b>Client policy</b></a>
|
||||||
% endif
|
% endif
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -4,8 +4,8 @@
|
||||||
<div class="consent" class="block">
|
<div class="consent" class="block">
|
||||||
Allow access to ${relaying_party}<br>
|
Allow access to ${relaying_party}<br>
|
||||||
Select the information you want to share with ${relaying_party}.
|
Select the information you want to share with ${relaying_party}.
|
||||||
% if policy_url:
|
% if policy_uri:
|
||||||
Please review the ${relaying_part} <a href="${policy_url}"><b>privacy policy</b></a>
|
Please review the ${relaying_part} <a href="${policy_uri}"><b>privacy policy</b></a>
|
||||||
% endif
|
% endif
|
||||||
|
|
||||||
<form action="${action}" method="post" class="consent form">
|
<form action="${action}" method="post" class="consent form">
|
||||||
|
@ -27,6 +27,6 @@
|
||||||
</table>
|
</table>
|
||||||
</form>
|
</form>
|
||||||
% if logo_url:
|
% if logo_url:
|
||||||
<img src="${logo_url}" alt="Client logo">
|
<img src="${logo_uri}" alt="Client logo">
|
||||||
% endif
|
% endif
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -22,10 +22,10 @@
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</form>
|
</form>
|
||||||
% if logo_url:
|
% if logo_uri:
|
||||||
<img src="${logo_uri}" alt="Client logo">
|
<img src="${logo_uri}" alt="Client logo">
|
||||||
% endif
|
% endif
|
||||||
% if policy_url:
|
% if policy_uri:
|
||||||
<a href="${policy_uri}"><b>Client policy</b></a>
|
<a href="${policy_uri}"><b>Client policy</b></a>
|
||||||
% endif
|
% endif
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -17,8 +17,8 @@ SERVICE = {
|
||||||
"pyoidcOICStatic": {
|
"pyoidcOICStatic": {
|
||||||
#{'client_secret':
|
#{'client_secret':
|
||||||
# '1e1254a35bf2000dff6daaef35660a85f7f17b5a0d5192da7838dfb1',
|
# '1e1254a35bf2000dff6daaef35660a85f7f17b5a0d5192da7838dfb1',
|
||||||
# 'policy_url': '', 'redirect_uris': [('http://hashog.umdc.umu
|
# 'policy_uri': '', 'redirect_uris': [('http://hashog.umdc.umu
|
||||||
# .se:8666/pyoidcOICStatic', None)], 'logo_url': '', 'client_id':
|
# .se:8666/pyoidcOICStatic', None)], 'logo_uri': '', 'client_id':
|
||||||
# 'VJNL62bPdOnn'}
|
# 'VJNL62bPdOnn'}
|
||||||
"opKey": "pyoidcOICStatic",
|
"opKey": "pyoidcOICStatic",
|
||||||
"client_id": "VJNL62bPdOnn",
|
"client_id": "VJNL62bPdOnn",
|
||||||
|
|
|
@ -38,7 +38,7 @@ class CDB(object):
|
||||||
def items(self):
|
def items(self):
|
||||||
return self.cdb.items()
|
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:
|
if redirect_uris is None:
|
||||||
print 'Enter redirect_uris one at the time, end with a blank line: '
|
print 'Enter redirect_uris one at the time, end with a blank line: '
|
||||||
redirect_uris = []
|
redirect_uris = []
|
||||||
|
@ -48,10 +48,10 @@ class CDB(object):
|
||||||
redirect_uris.append(redirect_uri)
|
redirect_uris.append(redirect_uri)
|
||||||
else:
|
else:
|
||||||
break
|
break
|
||||||
if not policy_url:
|
if not policy_uri:
|
||||||
policy_url = raw_input("Enter policy_url or just return: ")
|
policy_uri = raw_input("Enter policy_uri or just return: ")
|
||||||
if not logo_url:
|
if not logo_uri:
|
||||||
logo_url = raw_input("Enter logo_url or just return: ")
|
logo_uri = raw_input("Enter logo_uri or just return: ")
|
||||||
|
|
||||||
client_id = rndstr(12)
|
client_id = rndstr(12)
|
||||||
while client_id in self.cdb:
|
while client_id in self.cdb:
|
||||||
|
@ -63,8 +63,8 @@ class CDB(object):
|
||||||
"client_secret": client_secret,
|
"client_secret": client_secret,
|
||||||
"client_id": client_id,
|
"client_id": client_id,
|
||||||
"redirect_uris": pack_redirect_uri(redirect_uris),
|
"redirect_uris": pack_redirect_uri(redirect_uris),
|
||||||
"policy_url": policy_url,
|
"policy_uri": policy_uri,
|
||||||
"logo_url": logo_url,
|
"logo_uri": logo_uri,
|
||||||
}
|
}
|
||||||
|
|
||||||
return self.cdb[client_id]
|
return self.cdb[client_id]
|
||||||
|
|
|
@ -424,7 +424,7 @@ class Provider(object):
|
||||||
authn_args = {"query": request}
|
authn_args = {"query": request}
|
||||||
|
|
||||||
cinfo = self.cdb[areq["client_id"]]
|
cinfo = self.cdb[areq["client_id"]]
|
||||||
for attr in ["policy_url", "logo_url"]:
|
for attr in ["policy_uri", "logo_uri"]:
|
||||||
try:
|
try:
|
||||||
authn_args[attr] = cinfo[attr]
|
authn_args[attr] = cinfo[attr]
|
||||||
except KeyError:
|
except KeyError:
|
||||||
|
|
|
@ -656,7 +656,11 @@ class Provider(AProvider):
|
||||||
# If redirect_uri was in the initial authorization request
|
# If redirect_uri was in the initial authorization request
|
||||||
# verify that the one given here is the correct one.
|
# verify that the one given here is the correct one.
|
||||||
if "redirect_uri" in _info:
|
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")
|
_log_debug("All checks OK")
|
||||||
|
|
||||||
|
@ -1085,8 +1089,9 @@ class Provider(AProvider):
|
||||||
_rat = rndstr(32)
|
_rat = rndstr(32)
|
||||||
reg_enp = ""
|
reg_enp = ""
|
||||||
for endp in self.endp:
|
for endp in self.endp:
|
||||||
if isinstance(endp, RegistrationEndpoint):
|
if endp == RegistrationEndpoint:
|
||||||
reg_enp = "%s%s" % (self.baseurl, endp.etype)
|
reg_enp = "%s%s" % (self.baseurl, endp.etype)
|
||||||
|
break
|
||||||
|
|
||||||
self.cdb[client_id] = {
|
self.cdb[client_id] = {
|
||||||
"client_id": client_id,
|
"client_id": client_id,
|
||||||
|
|
|
@ -184,7 +184,7 @@ class UsernamePasswordMako(UserAuthnMethod):
|
||||||
except KeyError:
|
except KeyError:
|
||||||
argv["login"] = ""
|
argv["login"] = ""
|
||||||
|
|
||||||
for param in ["policy_url", "logo_url", "query"]:
|
for param in ["policy_uri", "logo_uri", "query"]:
|
||||||
try:
|
try:
|
||||||
argv[param] = kwargs[param]
|
argv[param] = kwargs[param]
|
||||||
except KeyError:
|
except KeyError:
|
||||||
|
|
Reference in New Issue