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

Wrong JSON field name for Code in TokenRequest #5

Closed
daic0r opened this issue Sep 26, 2024 · 1 comment
Closed

Wrong JSON field name for Code in TokenRequest #5

daic0r opened this issue Sep 26, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@daic0r
Copy link
Contributor

daic0r commented Sep 26, 2024

Bug report

Describe the bug

The field Code in types.TokenRequest has a wrong name in the struct field tag.
Therefore, code exchange for grant type "pkce" does not work and returns an error:

{"code":400,"error_code":"validation_failed","msg":"invalid request: both auth code and code verifier should be non-empty"}

The name in the field tag is currently code, but ought to be auth_code instead.

To Reproduce

  1. Initiate a PKCE flow via the /auth/v1/authorize endpoint and save the returned code verifier in a cookie

  2. Receive callback and parse code

  3. Create a TokenRequest with the grant type "pkce" and set Code to the parsed code and the verifier to the one saved in step 1:
    Thu Sep 26 05:29:59 PM CEST 2024

  4. Call Token and pass the TokenRequest object from step 3

  5. You will receive the error mentioned above

Expected behavior

No error, access token should be received correctly.

@kwoodhouse93
Copy link
Collaborator

Addressed by #6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants