Hi,
I have been struggling a lot with Auth0 with random 401 response when calling either auth0 apis or my own python flask API. This has been lasting for a long time.
My environment:
Nodejs 16, Nextjs 12.1.4, Nextjs-auth0 1.7.0
Authenticate using SSR Nextjs paradigm
Docker, Azure web app service
Cloudflare as my DNS provider
Auth0 webapp settinig:
Regular Web Application
In the same endpoint calls, the endpoint calls fail from time to time:
The accesstoken sometimes does not have the right RSA key (kid missing).
This happens to almost all endpoints, including other examples provided by auth0 sdk example:
/api/auth/me
/api/auth/profile
The weird thing is that in my development deployment, this does not happen
The access tokens are identical for both failing and ok API calls and the signature is verified using jwt.io. auth0-python==3.13.0 is SDK used in Flask. It is happening in almost all endpoints from my side and I do not see a clear pattern when it shall happen.