Repository navigation
Only require PKCE for the authorization code exchange - #582
Merged
Merged
Conversation
fapi2_security_profile sets require_pkce, but add_pkce_verifier was applied to every token request, so refresh and client_credentials failed with pkce_verifier_required. RFC 7636 only binds the authorization code grant. Fixes erlef#581 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
maennchen
approved these changes
Nov 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #581
require_pkce(set byfapi2_security_profile) was enforced for every token request, sorefresh/3andclient_credentials/2failed withpkce_verifier_required. Per RFC 7636 and FAPI 2.0 §5.3.2.2, PKCE only binds the authorization code to token exchange, as @maennchen noted on the issue.retrieve_a_token/5now only adds/enforces the PKCE verifier whengrant_typeisauthorization_code.Test plan
refresh_and_client_credentials_ignore_require_pkce_testinoidcc_token_test; fails before the change, passes after.rebar3 eunit --module=oidcc_token_test(44 tests, 0 failures),rebar3 fmt --check,rebar3 lintclean.rebar3 dialyzercrashed in rebar_core on this sandbox while updating the PLT, so it was not run.AI disclosure: this change was prepared with Claude (Claude Code).