Skip to content
This repository was archived by the owner on Jun 12, 2021. It is now read-only.

Commit 8bc81b1

Browse files
committed
More info on error.
1 parent 18b13d6 commit 8bc81b1

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

src/oidcendpoint/endpoint.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -285,8 +285,9 @@ def client_authentication(self, request, auth=None, **kwargs):
285285
raise
286286

287287
if authn_info["method"] not in self.client_authn_method:
288-
LOGGER.warning("Wrong client authentication method was used")
289-
raise WrongAuthnMethod("Wrong authn method")
288+
LOGGER.error("Wrong client authentication method was used: %s",
289+
authn_info["method"])
290+
raise WrongAuthnMethod("Wrong authn method: {}".format(authn_info["method"]))
290291

291292
return authn_info
292293

@@ -351,6 +352,8 @@ def do_response(self, response_args=None, request=None, error="", **kwargs):
351352
if response_args is None:
352353
response_args = {}
353354

355+
LOGGER.debug("do_response kwargs: %s", kwargs)
356+
354357
resp = None
355358
if error:
356359
_response = ResponseMessage(error=error)
@@ -393,7 +396,11 @@ def do_response(self, response_args=None, request=None, error="", **kwargs):
393396
try:
394397
fragment_enc = kwargs["fragment_enc"]
395398
except KeyError:
396-
fragment_enc = fragment_encoding(kwargs["return_type"])
399+
_ret_type = kwargs.get("return_type")
400+
if _ret_type:
401+
fragment_enc = fragment_encoding(_ret_type)
402+
else:
403+
fragment_enc = False
397404

398405
if fragment_enc:
399406
resp = _response.request(kwargs["return_uri"], True)

src/oidcendpoint/oidc/authorization.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
from oidcmsg.oauth2 import AuthorizationErrorResponse
1515
from oidcmsg.oauth2 import AuthorizationRequest
1616
from oidcmsg.oidc import AuthorizationResponse
17+
from oidcmsg.oidc import Claims
1718
from oidcmsg.oidc import verified_claim_name
1819

1920
from oidcendpoint import rndstr
@@ -139,6 +140,9 @@ def acr_claims(request):
139140
acrdef = None
140141

141142
_claims = request.get('claims')
143+
if isinstance(_claims, str):
144+
_claims = Claims().from_json(_claims)
145+
142146
if _claims:
143147
_id_token_claim = _claims.get("id_token")
144148
if _id_token_claim:

0 commit comments

Comments
 (0)