[keycloak-user] Spring Boot with multiple Keycloak instances

Sebastien Blanc sblanc at redhat.com
Fri Mar 2 03:48:57 EST 2018


Hi Cedric,

You mention "keycloak.json" so I assume you are using the Spring Security
Adapter ? If this is the case we don't' have an out of the box solution but
you can solve it by implementing your own KeycloakConfigResolver , take a
look here
http://www.keycloak.org/docs/latest/securing_apps/index.html#_multi_tenancy
then in your Spring Boot app declare a bean to point to the new config
resolver like :

@Bean
    public KeycloakConfigResolver KeycloakConfigResolver() {
        return new MyCustomConfigResolver();
    }

If you are using Spring Boot adapter "standalone" with the config in the
properties file, then we don't support multitenancy yet but we are working
on a solution.

On Fri, Mar 2, 2018 at 9:25 AM, Cedric Thiebault <
cedric.thiebault at sensefly.com> wrote:

> Hello,
>
> We are developing a REST API (Spring Boot micro-services) secured by
> Keycloak.
>
> We would like to use 2 different Keycloak instances:
> - one for employees linked to our Active Directory
> - one for our customers
> The idea is to isolate environments to reduce the impact on customer side
> when modifying internal services...
>
> Securing a Spring Boot app with Keycloak Spring adapters is easy (thanks
> guys!). But I don't see in documentation how use 2 Keycloak instances as we
> always refer to a single keycloak.json.
>
> Is securing a Spring Boot app with 2 different Keycloak instances possible?
>
> Thanks for your help!
>
> Cedric
>
> _______________________________________________
> keycloak-user mailing list
> keycloak-user at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/keycloak-user
>


More information about the keycloak-user mailing list