Auth0 Home Blog Docs

Authorization-code-grant-pkce access_denied error

I’m making a react electron app (at this point a simple auth demo which I plan to apply to a larger project). I’m following: https://auth0.com/docs/api-auth/tutorials/authorization-code-grant-pkce as another thread recommended this for electron problems with auth lock. I am through to step 4. Exchange the Authorization Code for an Access Token, (IE I get my initial Auth Code but cannot get the token) making a request for a token returns {“error”:“access_denied”,“error_description”:“Unauthorized”}. My application is set as a web application, basic token endpoint authorization, and I checked the grant types include authorization code. Here is a gist with my code:
https://gist.github.com/edencorbin/fa7f8e9652ee9964025d0b1a9c686433

ComponentDidMount checks the url, as its also the same URL as the redirect, if the access_code is present it fires off the call (that fails) to get a token.

How can I resolve this error?

Can you try setting the app type to Native/Mobile? That solved the error for me the other day.

That worked for this issue for me as well thank you.

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.