NodeJS - Failed to obtain access token

Hello. I set up a local NodeJS server with nothing but Auth0 and Pug modules, along with pages for testing authentication. I set up the login & callback pages just like in the Quickstart guide for NodeJS. When a user logs in, the Log at the admin console says the user logged in successfully, but the page shows the error stated on the title.

I looked at the post with a similar problem, but the answers suggested to whitelist certain IP addresses if you set a Rule, Hook or custom database, neither of which I have set. Also, like the mentioned post, the local server is behind a company firewall.

The post I’m referring to is here.

A Node.js application will be performing an authorization code grant which means that after the end-user completes authentication with success the application will receive a code and the Node.js backend will have to perform a call to https://{YOUR_TENANT}.auth0.com/oauth/token in order to exchange it for tokens.

You mention the server is behind a company firewall so you need to make sure that the Node.js server can reach the endpoint mentioned above.

I tried suggestion, sending a POST request to the link you provided (with {YOUR_TENANT} replaced, of course). I got an error saying “Unable to get local issuer certificate”.

Hey there Anas!

Sorry for such delay in response. We’re doing our best in providing you the best developer support experience out there but sometimes the number of incoming questions is just too big. Sorry for inconvenience!

Are you still battling that issue and need further assistance?

1 Like