we are running a multi-tenant platform and use Keycloak for authentication purposes. We've set up a custom authentication flow that will talk to other back-end services, present a tenant selection form and then store the selected tenant via user session note in the authentication session. Later on we grab that note in a claim mapper that puts it into the token. So far so good.
The problem now is that with every re-start of the flow, the user has to select the tenant again and again. It would be great if we could store their selection from after the first login somewhere in the session (not the auth session). Then when the next flow is triggered and the Cookie authenticator kicks in, the tenant is grabbed from the session and no selection form is shown.
Is that possible?
I already tried KeycloakSession.setAttribute() and KeycloakSession.getAttribute() which didn't seem to work.
Thanks and cheers, Lars