[KEYCLOAK-10334] Keycloak Spring Boot Adapter shares configuration in static field

Signed-off-by: Nils Christian Ehmke <nils-christian.ehmke@bmiag.de>
This commit is contained in:
Nils Christian Ehmke 2019-05-27 15:37:29 +02:00 committed by Bruno Oliveira da Silva
parent 11c9684e7d
commit a58a0e7678
3 changed files with 8 additions and 8 deletions

View file

@ -50,9 +50,9 @@ public class KeycloakBaseSpringBootConfiguration {
protected KeycloakSpringBootProperties keycloakProperties; protected KeycloakSpringBootProperties keycloakProperties;
@Autowired @Autowired
public void setKeycloakSpringBootProperties(KeycloakSpringBootProperties keycloakProperties) { public void setKeycloakSpringBootProperties(KeycloakSpringBootProperties keycloakProperties, KeycloakSpringBootConfigResolver resolver) {
this.keycloakProperties = keycloakProperties; this.keycloakProperties = keycloakProperties;
KeycloakSpringBootConfigResolver.setAdapterConfig(keycloakProperties); resolver.setAdapterConfig(keycloakProperties);
} }
@Autowired @Autowired

View file

@ -26,7 +26,7 @@ public class KeycloakSpringBootConfigResolver implements org.keycloak.adapters.K
private KeycloakDeployment keycloakDeployment; private KeycloakDeployment keycloakDeployment;
private static AdapterConfig adapterConfig; private AdapterConfig adapterConfig;
@Override @Override
public KeycloakDeployment resolve(OIDCHttpFacade.Request request) { public KeycloakDeployment resolve(OIDCHttpFacade.Request request) {
@ -34,12 +34,12 @@ public class KeycloakSpringBootConfigResolver implements org.keycloak.adapters.K
return keycloakDeployment; return keycloakDeployment;
} }
keycloakDeployment = KeycloakDeploymentBuilder.build(KeycloakSpringBootConfigResolver.adapterConfig); keycloakDeployment = KeycloakDeploymentBuilder.build(adapterConfig);
return keycloakDeployment; return keycloakDeployment;
} }
static void setAdapterConfig(AdapterConfig adapterConfig) { void setAdapterConfig(AdapterConfig adapterConfig) {
KeycloakSpringBootConfigResolver.adapterConfig = adapterConfig; this.adapterConfig = adapterConfig;
} }
} }

View file

@ -50,9 +50,9 @@ public class KeycloakAutoConfiguration extends KeycloakBaseSpringBootConfigurati
private KeycloakSpringBootProperties keycloakProperties; private KeycloakSpringBootProperties keycloakProperties;
@Autowired @Autowired
public void setKeycloakSpringBootProperties(KeycloakSpringBootProperties keycloakProperties) { public void setKeycloakSpringBootProperties(KeycloakSpringBootProperties keycloakProperties, KeycloakSpringBootConfigResolver resolver) {
this.keycloakProperties = keycloakProperties; this.keycloakProperties = keycloakProperties;
KeycloakSpringBootConfigResolver.setAdapterConfig(keycloakProperties); resolver.setAdapterConfig(keycloakProperties);
} }