Skip to content

Authorization Code + PKCE #1572

Closed
Closed
@Renkas

Description

Describe the bug
I'm using simple native JS client from: https://github.com/aaronpk/pkce-vanilla-js to test my Hydra instance with Authorization Code + PKCE grant. Everything works fine untill the access_token request. I keep getting the following error:

{
"error":"invalid_grant",
"error_description":"The provided authorization grant (e.g., authorization code, resource owner credentials) or refresh token is invalid, expired, revoked, does not match the redirection URI used in the authorization request, or was issued to another client",
"error_hint":"The PKCE code challenge did not match the code verifier.",
"status_code":400
}

I'm pretty sure challenge and verifier I send to the server are correct. I have also verifed that these values are really sent to the server.

code_verifier: 6e5ec79163ee989be79fa7a542f599d0e7c77038c8620aa44170217c
code_challenge: ZTE4MTMxZGRlMjA2ZGJiZjAyNTMyZjU3NjM0MThmOTkxYTQ4Y2EyZjFhY2Y1NjRmOGI1YWE1ZjJhYTRkYTE3Ng
These values are being sent to the server and AFAIK they are totally correct. But I still get the error stating that these dont match. I have hit a wall on debugging this.

I also had a look into Hydra DB and the table hydra_oauth2_pkce is empty. Shouldn't session data from authorization code request be saved there? Maybe that's what is creating the problem? Is there something I can do from my side?

Environment

  • Version: v1.0.1
  • Environment: Docker

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions