Search in sources :

Example 1 with InMemoryConfigHandler

use of org.keycloak.client.registration.cli.config.InMemoryConfigHandler in project keycloak by keycloak.

the class AbstractAuthOptionsCmd method processGlobalOptions.

protected void processGlobalOptions() {
    super.processGlobalOptions();
    if (config != null && noconfig) {
        throw new RuntimeException("Options --config and --no-config are mutually exclusive");
    }
    if (!noconfig) {
        setConfigFile(config != null ? config : ConfigUtil.DEFAULT_CONFIG_FILE_PATH);
        ConfigUtil.setHandler(new FileConfigHandler());
    } else {
        InMemoryConfigHandler handler = new InMemoryConfigHandler();
        ConfigData data = new ConfigData();
        initConfigData(data);
        handler.setConfigData(data);
        ConfigUtil.setHandler(handler);
    }
}
Also used : FileConfigHandler(org.keycloak.client.registration.cli.config.FileConfigHandler) RealmConfigData(org.keycloak.client.registration.cli.config.RealmConfigData) ConfigData(org.keycloak.client.registration.cli.config.ConfigData) InMemoryConfigHandler(org.keycloak.client.registration.cli.config.InMemoryConfigHandler)

Example 2 with InMemoryConfigHandler

use of org.keycloak.client.registration.cli.config.InMemoryConfigHandler in project keycloak by keycloak.

the class ConfigUtil method setupInMemoryHandler.

public static void setupInMemoryHandler(ConfigData config) {
    InMemoryConfigHandler memhandler = null;
    if (handler instanceof InMemoryConfigHandler) {
        memhandler = (InMemoryConfigHandler) handler;
    } else {
        memhandler = new InMemoryConfigHandler();
        handler = memhandler;
    }
    memhandler.setConfigData(config);
}
Also used : InMemoryConfigHandler(org.keycloak.client.registration.cli.config.InMemoryConfigHandler)

Aggregations

InMemoryConfigHandler (org.keycloak.client.registration.cli.config.InMemoryConfigHandler)2 ConfigData (org.keycloak.client.registration.cli.config.ConfigData)1 FileConfigHandler (org.keycloak.client.registration.cli.config.FileConfigHandler)1 RealmConfigData (org.keycloak.client.registration.cli.config.RealmConfigData)1