Skip to content

Commit 0fa527c

Browse files
committed
add additional check, verifying whether the user requested PKCE validation
1 parent 860eb67 commit 0fa527c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/pyop/provider.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ def _verify_code_exchange_req(self, token_request, authentication_request):
370370
raise InvalidTokenRequest('Invalid redirect_uri: {} != {}'.format(token_request['redirect_uri'],
371371
authentication_request['redirect_uri']),
372372
token_request)
373-
if not self._PKCE_verify(token_request, authentication_request):
373+
if 'code_challenge' in authentication_request and not self._PKCE_verify(token_request, authentication_request):
374374
raise InvalidTokenRequest('Unexpected Code Verifier: {}'.format(authentication_request['code_challenge']))
375375

376376
def _do_code_exchange(self, request, # type: Dict[str, str]

0 commit comments

Comments
 (0)