diff --git a/integration/adapter-core/src/main/java/org/keycloak/adapters/AdapterDeploymentContext.java b/integration/adapter-core/src/main/java/org/keycloak/adapters/AdapterDeploymentContext.java index b52b34e30e..532b2097e5 100755 --- a/integration/adapter-core/src/main/java/org/keycloak/adapters/AdapterDeploymentContext.java +++ b/integration/adapter-core/src/main/java/org/keycloak/adapters/AdapterDeploymentContext.java @@ -78,9 +78,11 @@ public class AdapterDeploymentContext { if (deployment == null) return null; if (deployment.getAuthServerBaseUrl() == null) return deployment; - deployment = resolveUrls(deployment, facade); - if (deployment.getRealmKey() == null) resolveRealmKey(deployment); - return deployment; + KeycloakDeployment resolvedDeployment = resolveUrls(deployment, facade); + if (resolvedDeployment.getRealmKey() == null) { + resolveRealmKey(resolvedDeployment); + } + return resolvedDeployment; } protected KeycloakDeployment resolveUrls(KeycloakDeployment deployment, HttpFacade facade) { diff --git a/integration/adapter-core/src/main/java/org/keycloak/adapters/KeycloakDeployment.java b/integration/adapter-core/src/main/java/org/keycloak/adapters/KeycloakDeployment.java index 4b13bd89de..f4b9c9029a 100755 --- a/integration/adapter-core/src/main/java/org/keycloak/adapters/KeycloakDeployment.java +++ b/integration/adapter-core/src/main/java/org/keycloak/adapters/KeycloakDeployment.java @@ -24,7 +24,7 @@ public class KeycloakDeployment { protected RelativeUrlsUsed relativeUrls; protected String realm; - protected PublicKey realmKey; + protected volatile PublicKey realmKey; protected String authServerBaseUrl; protected String realmInfoUrl; protected KeycloakUriBuilder authUrl;