Setup
-
Angular SPA,
auth0-spa-jsv1.13.6, New Universal Login -
Custom domain with OIDC proxy behind it
-
initiate_login_uriset to<APP_URL>/login
The problem
After logout + re-login immediately:
-
User submits credentials on the Auth0 login form
-
Instead of redirecting back to the app with
?code=&state=, the browser receives:<APP_URL>/?iss=https://<CUSTOM_DOMAIN>/ -
Angular app loads,
LoginComponentfiresloginWithRedirect()again -
The Auth0 login form re-renders — user has to log in a second time
-
On the second attempt it usually succeeds and lands on
/policies
However — if the user waits a few minutes after logout and then tries to login, the issue does not occur. Login completes in one attempt as expected.
This never happens with the standard tenant domain (xxx.eu.auth0.com) regardless of timing.
What we have tried — none fully resolved it
-
Removed / blanked
initiate_login_uri→ no effect -
prompt: 'login'+max_age: 0onloginWithRedirect()→ reduces frequency, not eliminated -
federated: trueonlogout()→ helps but issue still occurs immediately after logout -
Passing
issback in subsequentloginWithRedirect()→ intermittent improvement -
Clearing browser cookies for custom domain → fixes it temporarily
Key observations
-
Issue is timing dependent — happens immediately after logout, not after a wait. Suggests a stale session or token in the OIDC proxy that takes time to expire/clear
-
?iss=lands on app root (/?iss=), not/login?iss=— suggests the OIDC proxy behind the custom domain generates it, not Auth0’sinitiate_login_uri -
prompt=logindoes not suppress the?iss=redirect — proxy appears to ignore it -
Opening the login URL in a second browser window during an active login reliably triggers the issue
Questions
-
Is the
?iss=redirect caused by a stale session in the OIDC proxy not yet cleared afterfederated: truelogout? -
Why does this only happen with the custom domain and not the standard tenant domain?
-
Is the OIDC proxy behind the custom domain responsible for generating
?iss=, not Auth0 itself? -
Is there a way to force the proxy session to clear immediately on logout rather than waiting for natural expiry?
-
Does upgrading to
auth0-spa-jsv2.x resolve this?