Getting id_token not present in TokenSet on logout

I followed the Node.js (Express) instructions under application / quickstart and got my first auth0 app using express working.

const { auth } = require( 'express-openid-connect' );
app.use( auth( {
		               authRequired: false,
		               auth0Logout: true,
		               baseURL: 'http://mydomain.local',
		               clientID: configuration.auth0.clientID,
		               secret: configuration.auth0.secret,
		               issuerBaseURL: 'https://xxxxxx'
	               } ) );

the express app runs on localhost:3000 and everything works when baseURL is set to http://localhost:3000.

Then I created an Nginx reverse proxy for it so that https://mydomain.local proxies tohttp://localhost:3000and changed baseURL to https://mydomain.local.

my current problem is that when in my browser i open https://mydomain.local/logout, i get an error:

"code": 500,
"message": "id_token not present in TokenSet"

On the auth0 management dashboard i have both domains configured as:
Allowed Callback URLs:
http://localhost:3000/callback, https://mydomain.local/callback

Allowed Logout URLs

http://localhost:3000/, https://mydomain.local/

Allowed Web Origins

http://localhost:3000, https://mydomain.local

Allowed Origins (CORS)

http://localhost:3000, https://mydomain.local

Does anybody know what am i missing here or what did i do wrong ?

  • SDK Version: express-openid-connect@2.7.2

Did you get any solution?

not yet. been battling with this all day yesterday and today is round 2 :smiley:

I figured out what was happening after adding some debug log messages in the dependency “express-openid-connect” and noticed that the main reason has nothing to do with the SDK or even auth0.

I had a typo in the nginx route configuration and I never saw it up until I added the debug messages.

fixing the typo in the nginx configuration solved the problem for me. All the stuff I added in the code sample above are correct and working properly.

1 Like

Hey @mikehajj good to know you sorted this out, and thanks a bunch for following up here as well! :smile:

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