Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fallback to PKCE RFC parameter names #7034

Merged
merged 4 commits into from Mar 12, 2024
Merged

Conversation

scotttrinh
Copy link
Contributor

I played it a little fast-and-loose when implementing our PKCE implementation since we are not an OAuth authorization flow and therefore are not building an actual PKCE flow, just something inspired by it. However, there are some existing tools that can take advantage of the code exchange if we align with the same parameter names outlined in RFC 7636.

Added a note in the docs for anyone who might be familiar with how RFC 7636 defines PKCE to highlight the differences.

Closes #7026


Special note here about omitting support for code_challenge_method:

If the client is capable of using "S256", it MUST use "S256", as
"S256" is Mandatory To Implement (MTI) on the server. Clients are
permitted to use "plain" only if they cannot support "S256" for some
technical reason and know via out-of-band configuration that the
server supports "plain".

RFC 7636 Section 4.2

Since our PKCE flow is always a server-to-server flow, we require that clients provide a SHA256 hashed challenge, and do not accept plain as a code_challenge_method since it negates the added security of PKCE. The RFC specifies that if the code_challenge_method is omitted that the server treat the challenge as plain, but we do not support plain. I considered conforming here but always requiring implementors to provide the constant S256 value, but that seemed low value and an unnecessary hurdle. In the future we could chose to require it and return a failure status of 400 if you do not provide it if we want to add additional compatibility with RFC 7636.

@scotttrinh scotttrinh requested a review from fantix March 12, 2024 16:09
edb/server/protocol/auth_ext/http.py Outdated Show resolved Hide resolved
@scotttrinh scotttrinh merged commit a4ecdb5 into master Mar 12, 2024
23 checks passed
@scotttrinh scotttrinh deleted the 7026-pkce-rfc-params branch March 12, 2024 17:51
msullivan pushed a commit that referenced this pull request Mar 15, 2024
msullivan pushed a commit that referenced this pull request Mar 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Aliasing the PKCE Parameter "challenge" for RFC Alignment
3 participants