b355489b by Adam Heath

No longer hard-code the realm name in the service.

1 parent 024ec6a4
......@@ -272,10 +272,11 @@ Map<String, Object> pushKeycloakUser() {
Map<String, Object> getKeycloakUsers() {
String keycloakClientId = 'moqui'
Keycloak keycloak = ec.getTool('Keycloak', Keycloak.class)
KeycloakToolFactory keycloakToolFactory = ec.getFactory().getToolFactory('Keycloak')
Keycloak keycloak = keycloakToolFactory.getInstance()
try {
RealmResource realm = keycloak.realm('master')
RealmResource realm = keycloak.realm(keycloakToolFactory.getRealmName())
/*
ServerInfoResource serverInfo = keycloak.serverInfo()
logger.info('keycloak serverInfo: ' + keycloakToJson(serverInfo.getInfo()))
......
......@@ -70,6 +70,10 @@ class KeycloakToolFactory implements ToolFactory<Keycloak> {
return keycloakBuilder.build()
}
String getRealmName() {
return (String) System.getProperty("moqui_keycloak_realm")
}
@Override
void destroy() {
}
......