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

Commit 230d04e

Browse files
committed
Don't set default value to pkce essential
1 parent bf8a63b commit 230d04e

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

src/oidcop/oidc/add_on/pkce.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@ def post_authn_parse(request, client_id, endpoint_context, **kwargs):
4343
if "pkce_essential" in client:
4444
essential = client["pkce_essential"]
4545
else:
46-
essential = endpoint_context.args["pkce"]["essential"]
46+
essential = endpoint_context.args["pkce"].get(
47+
"essential", False
48+
)
4749
if essential and "code_challenge" not in request:
4850
return AuthorizationErrorResponse(
4951
error="invalid_request", error_description="Missing required code_challenge",
@@ -134,9 +136,6 @@ def add_pkce_support(endpoint: Dict[str, Endpoint], **kwargs):
134136
authn_endpoint.post_parse_request.append(post_authn_parse)
135137
token_endpoint.post_parse_request.append(post_token_parse)
136138

137-
if "essential" not in kwargs:
138-
kwargs["essential"] = False
139-
140139
code_challenge_methods = kwargs.get("code_challenge_methods", CC_METHOD.keys())
141140

142141
kwargs["code_challenge_methods"] = {}

0 commit comments

Comments
 (0)