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

PKCE code verifier does not follow RFC (use "~" and "." as characters) #9676

Open
k-funk opened this issue Mar 31, 2021 · 0 comments
Open

PKCE code verifier does not follow RFC (use "~" and "." as characters) #9676

k-funk opened this issue Mar 31, 2021 · 0 comments

Comments

@k-funk
Copy link

k-funk commented Mar 31, 2021

Hosted Link: https://auth0.com/docs/flows/call-your-api-using-the-authorization-code-flow-with-pkce#create-code-verifier
Src: https://github.com/auth0/docs/blob/master/articles/flows/guides/auth-code-pkce/includes/create-code-verifier.md

(This issue may also be a problem for other languages, but I'll only speak to JS.)

Issue

The example uses base64URLEncode(crypto.randomBytes(32)) to create a code verifier. However, the characters ~ and . are never part of the verifier strings, as the RFC suggests that they should be.

Comparison to pkce-challenge

I compared this to the npm package pkce-challenge. I asked the maintainer why he wasn't using the simpler solution that your docs proppose.. I also created a codesandbox to verify the comparisons.


Am I missing something here, or are the docs needing to be updated (or at least mention that it doesn't follow the RFC)?

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

No branches or pull requests

1 participant