Keycloak Token api PKCE code verifier not specified

Viewed 64

I attempted to authenticate the vuejs application with Kecloak, but I received a PKCE code verifier not specified error while attempting to exchange an authorization code for an access token using the keycloak token api (http://localhost:8080/realms/kredo-dev/protocol/openid-connect/token).

I am sending code, client_id, redirect_uri, response_type, grant_type in the payload.

The error for the request is {"error": "invalid_grant," "error_description": "PKCE code verifier not specified"}

1 Answers

Going to take a wild guess that you're using keycloak-js. When you initialize your keycloak object, ensure you specify pkceMethod.

keycloak.init({
    ...
    pkceMethod: "S256"
})
Related