Issue Summary
When Cloud Foundry UAA identityZone is configured with an external Identity Provider (Okta, Entra, etc), users encounter an “Invalid state parameter” error if they initiate the login flow in two different browser tabs using the same browser.
The second login attempt overwrites the state stored in UAA’s session, causing the first login callback to fail.
Steps to Reproduce
- Configure CF UAA identity zone with an external OIDC provider (Okta).
- From the same browser session, open two tabs:
- Tab 1 → navigate to /oauth/authorize endpoint
- Tab 2 → navigate to /oauth/authorize endpoint
- UAA generates a state value and stores it in the session for Tab 1 (S1).
- User triggers login from Tab 2 → UAA overwrites the session state with S2.
- Complete the login in Tab 1 by entering Okta credentials.
- Okta redirects back to UAA with state=S1.
- UAA rejects the request with “Invalid state parameter” because the session now contains state=S2.
Expected Behavior
Ideally, UAA should either:
- Support multiple concurrent login transactions per session,
or
- Reject one of the login attempts early with a clear warning,
or
- Provide configuration options to manage state per request or store state per tab.
(Currently UAA supports only one login transaction per session.)