Id_token not present in TokenSet

Hi!

I’m having a strange issue that isn’t occurring locally but is occurring when I deploy.

I’ve set my scope to be “openid profile” and this is working locally. I’ve got exactly the same env vars in my deployed instance.

I notice that when I login from my local deploy I see an authenticate prompt between Univeral Login and my application:

This doesn’t happen for me on the deployed version.

I’m using Next.js and ‘@auth0/nextjs-auth0’ library. The error seems to be happening on the callback route. I am using a rule to enhance the profile with metadata and am sending state to Auth0 and checking it on the way back.

I’ve checked settings are the same, code is the same and connections are the same.

I’ve got this same basic architecture deployed for several applications and am struggling to work out what is wrong here.

Any help gratefully received!!

Kevin.

This was totally me.

I figured the problem was to do with scope (and it was).

Locally, in my .env file I set the scope to “openid profile” because I wanted both of those scope available. In a .env file, it’s necessary to have the scopes for space separated values.

On Vercel, I kept the quotes which is what was breaking the flow. Instead of "openid profile", I should have had openid profile. After some logging of the serverless functions I spotted my error.

Leaving this here for posterity (and to remind me of the problem in future!).

2 Likes

Glad you have figured it out and thanks for sharing it with the rest of community!

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