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

Commit 816498c

Browse files
committed
Log
1 parent 381fcf1 commit 816498c

2 files changed

Lines changed: 12 additions & 10 deletions

File tree

src/oidcrp/oauth2/utils.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1+
import logging
2+
13
from oidcmsg.exception import MissingParameter
24

5+
logger = logging.getLogger(__name__)
6+
37

48
def get_state_parameter(request_args, kwargs):
59
"""Find a state value from a set of possible places."""
@@ -23,23 +27,21 @@ def pick_redirect_uris(request_args=None, service=None, **kwargs):
2327

2428
_callback = _context.callback
2529
if _callback:
26-
try:
27-
_response_type = request_args['response_type']
28-
except KeyError:
29-
_response_type = _context.behaviour['response_types'][0]
30-
request_args['response_type'] = _response_type
30+
_response_type = request_args.get('response_type', _context.behaviour['response_types'][0])
31+
request_args['response_type'] = _response_type
3132

32-
try:
33-
_response_mode = request_args['response_mode']
34-
except KeyError:
35-
_response_mode = ''
33+
_response_mode = request_args.get('response_mode')
3634

3735
if _response_mode == 'form_post':
3836
request_args['redirect_uri'] = _callback['form_post']
3937
elif _response_type == 'code':
4038
request_args['redirect_uri'] = _callback['code']
4139
else:
4240
request_args['redirect_uri'] = _callback['implicit']
41+
42+
logger.debug(
43+
f"pick_redirect_uris: response_type={_response_type}, response_mode={_response_mode}, "
44+
f"redirect_uri={request_args['redirect_uri']}")
4345
else:
4446
request_args['redirect_uri'] = _context.redirect_uris[0]
4547

src/oidcrp/rp_handler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -775,7 +775,7 @@ def finalize(self, issuer, response, behaviour_args: Optional[dict] = None):
775775
client = self.issuer2rp[issuer]
776776

777777
if behaviour_args:
778-
logger.debug(f"Behaviour args: {behaviour_args}")
778+
logger.debug(f"Finalize behaviour args: {behaviour_args}")
779779

780780
authorization_response = self.finalize_auth(client, issuer, response)
781781
if is_error_message(authorization_response):

0 commit comments

Comments
 (0)