File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11from oic .oauth2 .message import SINGLE_OPTIONAL_STRING
22from oic .oic import message
33
4- class AccessTokenRequest (message .Message ):
4+ class AccessTokenRequest (message .AccessTokenRequest ):
55 c_param = message .AccessTokenRequest .c_param .copy ()
66 c_param .update (
77 {
88 'code_verifier' : SINGLE_OPTIONAL_STRING
99 }
1010 )
1111
12- class AuthorizationRequest (message .Message ):
12+ class AuthorizationRequest (message .AuthorizationRequest ):
1313 c_param = message .AuthorizationRequest .c_param .copy ()
1414 c_param .update (
1515 {
Original file line number Diff line number Diff line change @@ -381,7 +381,7 @@ def _verify_code_exchange_req(self,
381381 :param token_request: The request asking for a token given a code, and optionally a code_verifier
382382 :param authentication_request: The authentication request belonging to the provided code.
383383 :raises InvalidTokenRequest, InvalidAuthorizationCode: If request is invalid, throw a representing exception.
384- """
384+ """
385385 if token_request ['client_id' ] != authentication_request ['client_id' ]:
386386 logger .info ('Authorization code \' %s\' belonging to \' %s\' was used by \' %s\' ' ,
387387 token_request ['code' ], authentication_request ['client_id' ], token_request ['client_id' ])
@@ -391,7 +391,8 @@ def _verify_code_exchange_req(self,
391391 authentication_request ['redirect_uri' ]),
392392 token_request )
393393 if 'code_challenge' in authentication_request and not self ._PKCE_verify (token_request , authentication_request ):
394- raise InvalidTokenRequest ('Unexpected Code Verifier: {}' .format (authentication_request ['code_challenge' ]))
394+ raise InvalidTokenRequest ('Unexpected Code Verifier: {}' .format (authentication_request ['code_challenge' ]),
395+ token_request )
395396
396397 def _do_code_exchange (self , request , # type: Dict[str, str]
397398 extra_id_token_claims = None
You can’t perform that action at this time.
0 commit comments