How a Spring Backend Eliminated Per-Request Auth0 /userinfo API Calls
A development team discovered their Spring backend was making repeated HTTP calls to Auth0's /userinfo endpoint on nearly every request because the access token lacked an email claim by default. The fallback mechanism relied on Redis caching, but cache misses during cold starts, deploys, and new user logins still triggered live Auth0 API calls, creating a performance and availability risk. Multiplied across the user base and token rotations, this resulted in a significant unintended dependency on Auth0's response times. The team resolved the issue by using Auth0's Post-Login Actions to embed required user claims — such as email, name, and picture — directly into the access token at issuance time. This eliminated the need for any /userinfo lookup at request time, making the backend self-sufficient with the data carried in the token itself.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in