Thank you for posting your question on the Auth0 Community!
Regarding the 401 Unauthorized that you receive for the profile, these could be possible causes for the issue:
- For the Auth0 Scopes, can you double check if you have them declared as
AUTH0_SCOPE= "openid email profile"
in Vercel? Changing it toAUTH0_SCOPE=openid email profile
might do the trick since quotation marks might cause the error in the environment variables. - I have checked your tenant and it appears that you have two similar applications, please double check if the Client ID and Client Secret are the correct ones.
For the Invalid URL error that you are receiving, please check if in your application’s settings you have the same URL that you are redirecting to in the Allowed Callback URLs. Please double check if all other URLs are matching as well.
For the Vercel 500 error, please review the following:
- Community post regarding NextJS application not working on Vercel Cloud
- DevHub post regarding Deploying React App Secured By Auth0 to Vercel
- Try to include www. in all the env variables and the callback URLs
- Community post regarding Generic v4 Errors. To save you time reading through the post, one of the users mentioned:
I had issue with .env having https, once changed to without https. The login url started to work.
AUTH0_DOMAIN=“.eu.auth0.com”
V3 supported https:// in AUTH0_DOMAIN and it looks like it has been dropped in V4. Find it out by console logging middleware object and seeing double https in issuer
It looks like the issue was that
AUTH0_DOMAIN
was set to localhost instead of the domain Auth0 provides for it’s identity service (the ENV variable that used to beAUTH0_ISSUER_BASE_URL
).
If you have any additional questions or if the proposed solutions above helped solve the issue, feel free to leave a reply on the post!
Kind Regard,
Nik