I have some Spring Boot microservices with Spring Cloud API gateway (Zuul) in front of them.
API gateway authenticates users and forward the Authorization bearer token header.
Working fine with a single realm.
Now, I'd like to use multiple realms.
Using KeycloakConfigResolver, I'm able to authenticate user with the API gateway (keycloak deployment based on path).
But how should I configure KeycloakConfigResolver for microservices (bearer-only) so the use the right KeycloakDeployment? As every service can be accessed by both realms I don't know how to detect against which realm user was authenticated?
I cannot use path for KeycloakConfigResolver
as for example for the order-service, users can do a GET on /orders
being authenticated by realm1 or realm2...
Using header does not seem to be a good solution either.... Any idea?
I hope I'm clear enough...