From a58a0e76786b9a0146038188f83359d8a49ecf55 Mon Sep 17 00:00:00 2001 From: Nils Christian Ehmke Date: Mon, 27 May 2019 15:37:29 +0200 Subject: [PATCH] [KEYCLOAK-10334] Keycloak Spring Boot Adapter shares configuration in static field Signed-off-by: Nils Christian Ehmke --- .../springboot/KeycloakBaseSpringBootConfiguration.java | 4 ++-- .../springboot/KeycloakSpringBootConfigResolver.java | 8 ++++---- .../adapters/springboot/KeycloakAutoConfiguration.java | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/adapters/oidc/spring-boot-adapter-core/src/main/java/org/keycloak/adapters/springboot/KeycloakBaseSpringBootConfiguration.java b/adapters/oidc/spring-boot-adapter-core/src/main/java/org/keycloak/adapters/springboot/KeycloakBaseSpringBootConfiguration.java index 47bc708718..358a6321d8 100755 --- a/adapters/oidc/spring-boot-adapter-core/src/main/java/org/keycloak/adapters/springboot/KeycloakBaseSpringBootConfiguration.java +++ b/adapters/oidc/spring-boot-adapter-core/src/main/java/org/keycloak/adapters/springboot/KeycloakBaseSpringBootConfiguration.java @@ -50,9 +50,9 @@ public class KeycloakBaseSpringBootConfiguration { protected KeycloakSpringBootProperties keycloakProperties; @Autowired - public void setKeycloakSpringBootProperties(KeycloakSpringBootProperties keycloakProperties) { + public void setKeycloakSpringBootProperties(KeycloakSpringBootProperties keycloakProperties, KeycloakSpringBootConfigResolver resolver) { this.keycloakProperties = keycloakProperties; - KeycloakSpringBootConfigResolver.setAdapterConfig(keycloakProperties); + resolver.setAdapterConfig(keycloakProperties); } @Autowired diff --git a/adapters/oidc/spring-boot-adapter-core/src/main/java/org/keycloak/adapters/springboot/KeycloakSpringBootConfigResolver.java b/adapters/oidc/spring-boot-adapter-core/src/main/java/org/keycloak/adapters/springboot/KeycloakSpringBootConfigResolver.java index 2f90402cf6..799a069786 100755 --- a/adapters/oidc/spring-boot-adapter-core/src/main/java/org/keycloak/adapters/springboot/KeycloakSpringBootConfigResolver.java +++ b/adapters/oidc/spring-boot-adapter-core/src/main/java/org/keycloak/adapters/springboot/KeycloakSpringBootConfigResolver.java @@ -26,7 +26,7 @@ public class KeycloakSpringBootConfigResolver implements org.keycloak.adapters.K private KeycloakDeployment keycloakDeployment; - private static AdapterConfig adapterConfig; + private AdapterConfig adapterConfig; @Override public KeycloakDeployment resolve(OIDCHttpFacade.Request request) { @@ -34,12 +34,12 @@ public class KeycloakSpringBootConfigResolver implements org.keycloak.adapters.K return keycloakDeployment; } - keycloakDeployment = KeycloakDeploymentBuilder.build(KeycloakSpringBootConfigResolver.adapterConfig); + keycloakDeployment = KeycloakDeploymentBuilder.build(adapterConfig); return keycloakDeployment; } - static void setAdapterConfig(AdapterConfig adapterConfig) { - KeycloakSpringBootConfigResolver.adapterConfig = adapterConfig; + void setAdapterConfig(AdapterConfig adapterConfig) { + this.adapterConfig = adapterConfig; } } \ No newline at end of file diff --git a/adapters/oidc/spring-boot/src/main/java/org/keycloak/adapters/springboot/KeycloakAutoConfiguration.java b/adapters/oidc/spring-boot/src/main/java/org/keycloak/adapters/springboot/KeycloakAutoConfiguration.java index 90837f5bcb..205b04b03d 100755 --- a/adapters/oidc/spring-boot/src/main/java/org/keycloak/adapters/springboot/KeycloakAutoConfiguration.java +++ b/adapters/oidc/spring-boot/src/main/java/org/keycloak/adapters/springboot/KeycloakAutoConfiguration.java @@ -50,9 +50,9 @@ public class KeycloakAutoConfiguration extends KeycloakBaseSpringBootConfigurati private KeycloakSpringBootProperties keycloakProperties; @Autowired - public void setKeycloakSpringBootProperties(KeycloakSpringBootProperties keycloakProperties) { + public void setKeycloakSpringBootProperties(KeycloakSpringBootProperties keycloakProperties, KeycloakSpringBootConfigResolver resolver) { this.keycloakProperties = keycloakProperties; - KeycloakSpringBootConfigResolver.setAdapterConfig(keycloakProperties); + resolver.setAdapterConfig(keycloakProperties); }