Skip to content

Commit 23ab1c4

Browse files
committed
verify that required request parameters have been supplied
1 parent 198814e commit 23ab1c4

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/pyop/provider.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,13 @@ def _PKCE_verify(self,
361361
:param authentication_request: the code_verfier to check against the code challenge.
362362
:returns: whether the code_verifier is what was expected given the cc_cm
363363
"""
364+
if not 'code_verifier' in token_request:
365+
return False
366+
367+
if not 'code_challenge_method' in authentication_request:
368+
raise InvalidTokenRequest("A code_challenge and code_verifier have been supplied"
369+
"but missing code_challenge_method in authentication_request", token_request)
370+
364371
code_challenge_method = authentication_request['code_challenge_method']
365372
if code_challenge_method == 'plain':
366373
return authentication_request['code_challenge'] == token_request['code_verifier']

0 commit comments

Comments
 (0)