we have an issue with the redirect to our applications after login when using multiple tabs.
We have 1 keycloak instance, and 2 applications, using the same realm and client for SSO. The applications are angular frontends, using the js adapter with "login-required" configuration.
What I do:
- open application A in tab 1, I see keycloak's login screen with the correct redirect_uri in the url
- open application B in tab 2, I see keycloak's login screen with the correct redirect_uri in the url
- login on tab 1
What I expect:
- application A opens in tab 1
- when I refresh or login on tab 2, application B opens
- application B opens in tab 1. Somehow it uses the redirect_uri of tab 2, which was opened after tab 1
- when I refresh tab 2, I also see application B, but it doesn't work, there is sth wrong with the tokens, the backend reports 401 on every request. After another refresh it works. When I log in instead of refresh, I get keycloaks "You are already logged in" screen.
When I open app B after I logged in to app A (or the other way around) everything works as expected: I don't need to login, and when I logout in one app the other one logs out too.