private UserApi createUserApi(ServiceBrokerOptions options) { KeycloakFactory keycloakFactory = new KubeKeycloakFactory(client, options.getStandardAuthserviceConfigName(), options.getStandardAuthserviceCredentialsSecretName(), options.getStandardAuthserviceCertSecretName()); return new KeycloakUserApi(keycloakFactory, Clock.systemUTC()); }
@Override public Keycloak createInstance() { ConfigMap keycloakConfig = openShiftClient.configMaps().withName(keycloakConfigName).get(); Secret credentials = openShiftClient.secrets().withName(keycloakCredentialsSecretName).get(); String keycloakUri = String.format("https://%s:8443/auth", keycloakConfig.getData().get("hostname")); Base64.Decoder b64dec = Base64.getDecoder(); String adminUser = new String(b64dec.decode(credentials.getData().get("admin.username")), StandardCharsets.UTF_8); String adminPassword = new String(b64dec.decode(credentials.getData().get("admin.password")), StandardCharsets.UTF_8); log.info("User keycloak URI {}", keycloakUri); Secret certificate = openShiftClient.secrets().withName(keycloakCertSecretName).get(); KeyStore trustStore = createKeyStore(b64dec.decode(certificate.getData().get("tls.crt"))); ResteasyClient resteasyClient = new ResteasyClientBuilder() .connectTimeout(30, TimeUnit.SECONDS) .connectionPoolSize(1) .asyncExecutor(executorService) // executorService is the replacement but returns the wrong type .trustStore(trustStore) .hostnameVerification(ResteasyClientBuilder.HostnameVerificationPolicy.ANY) .build(); return KeycloakBuilder.builder() .serverUrl(keycloakUri) .realm("master") .username(adminUser) .password(adminPassword) .clientId("admin-cli") .resteasyClient(resteasyClient) .build(); }
KeycloakFactory keycloakFactory = new KubeKeycloakFactory(client, keycloakConfigName, getKeycloakCredentialsSecretName(env),
KeycloakFactory keycloakFactory = new KubeKeycloakFactory(client, options.getStandardAuthserviceConfigName(), options.getStandardAuthserviceCredentialsSecretName(),
KeycloakFactory keycloakFactory = new KubeKeycloakFactory(controllerClient, options.getStandardAuthserviceConfigName(), options.getStandardAuthserviceCredentialsSecretName(),