diff --git a/tools/intersmash-tools-provisioners/src/main/java/org/jboss/intersmash/tools/util/keycloak/KeycloakAdminClient.java b/tools/intersmash-tools-provisioners/src/main/java/org/jboss/intersmash/tools/util/keycloak/KeycloakAdminClient.java index 6e1a31244..e748cf4d9 100644 --- a/tools/intersmash-tools-provisioners/src/main/java/org/jboss/intersmash/tools/util/keycloak/KeycloakAdminClient.java +++ b/tools/intersmash-tools-provisioners/src/main/java/org/jboss/intersmash/tools/util/keycloak/KeycloakAdminClient.java @@ -38,7 +38,8 @@ */ public class KeycloakAdminClient { - private Keycloak keycloak; + private final String realmName; + private final Keycloak keycloak; public KeycloakAdminClient(final String url, final String realm, final String username, final String password) throws KeyStoreException, NoSuchAlgorithmException, KeyManagementException { @@ -46,7 +47,7 @@ public KeycloakAdminClient(final String url, final String realm, final String us .create() .loadTrustMaterial(TrustAllStrategy.INSTANCE) .build(); - + realmName = realm; keycloak = Keycloak.getInstance( url, realm, @@ -62,7 +63,6 @@ public KeycloakAdminClient(final String url, final String realm, final String us */ public void importRealmConfiguration(InputStream is) throws IOException { PartialImportRepresentation piRep = JsonSerialization.readValue(is, PartialImportRepresentation.class); - // TODO - fix, the realm name should be passed in as a parameter - keycloak.realm("wildfly-realm").partialImport(piRep); + keycloak.realm(this.realmName).partialImport(piRep); } }