Skip to content

Commit 6735b2e

Browse files
committed
Add logging for when client using authorization code issued to other
1 parent 4fdcca9 commit 6735b2e

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/pyop/provider.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,8 @@ def _do_code_exchange(self, request, # type: Dict[str, str]
342342
authentication_request = self.authz_state.get_authorization_request_for_code(token_request['code'])
343343

344344
if token_request['client_id'] != authentication_request['client_id']:
345+
logger.info('Authorization code \'%s\' belonging to \'%s\' was used by \'%s\'',
346+
token_request['code'], authentication_request['client_id'], token_request['client_id'])
345347
raise InvalidAuthorizationCode('{} unknown'.format(token_request['code']))
346348
if token_request['redirect_uri'] != authentication_request['redirect_uri']:
347349
raise InvalidTokenRequest('Invalid redirect_uri: {} != {}'.format(token_request['redirect_uri'],

0 commit comments

Comments
 (0)