From 0d9d2908f1bcbfd0ee0cec07124bbaf9708d1dec Mon Sep 17 00:00:00 2001 From: Pedro Ruivo Date: Thu, 31 Oct 2024 09:47:41 +0000 Subject: [PATCH] Username and password should be optional for multi-site deployment (#34511) Fixes #34508 Signed-off-by: Pedro Ruivo --- .../runtime/storage/infinispan/CacheManagerFactory.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/storage/infinispan/CacheManagerFactory.java b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/storage/infinispan/CacheManagerFactory.java index 118171c3ce..2480228f5e 100644 --- a/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/storage/infinispan/CacheManagerFactory.java +++ b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/storage/infinispan/CacheManagerFactory.java @@ -156,8 +156,6 @@ public class CacheManagerFactory { Integer cacheRemotePort = Configuration.getOptionalKcValue(CACHE_REMOTE_PORT_PROPERTY) .map(Integer::parseInt) .orElse(ConfigurationProperties.DEFAULT_HOTROD_PORT); - String cacheRemoteUsername = requiredStringProperty(CACHE_REMOTE_USERNAME_PROPERTY); - String cacheRemotePassword = requiredStringProperty(CACHE_REMOTE_PASSWORD_PROPERTY); org.infinispan.client.hotrod.configuration.ConfigurationBuilder builder = new org.infinispan.client.hotrod.configuration.ConfigurationBuilder(); builder.addServer().host(cacheRemoteHost).port(cacheRemotePort); @@ -173,8 +171,8 @@ public class CacheManagerFactory { if (isRemoteAuthenticationEnabled()) { builder.security().authentication() .enable() - .username(cacheRemoteUsername) - .password(cacheRemotePassword) + .username(requiredStringProperty(CACHE_REMOTE_USERNAME_PROPERTY)) + .password(requiredStringProperty(CACHE_REMOTE_PASSWORD_PROPERTY)) .realm("default") .saslMechanism(SCRAM_SHA_512); }