Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Working external configuration through Spring Boot application.proper…
…ties
- Loading branch information
1 parent
273e945
commit a5246b8
Showing
3 changed files
with
53 additions
and
31 deletions.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
...boot/src/main/java/org/keycloak/adapters/springboot/KeycloakSpringBootConfigResolver.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package org.keycloak.adapters.springboot; | ||
|
||
import org.keycloak.adapters.HttpFacade; | ||
import org.keycloak.adapters.KeycloakDeployment; | ||
import org.keycloak.adapters.KeycloakDeploymentBuilder; | ||
import org.keycloak.representations.adapters.config.AdapterConfig; | ||
|
||
public class KeycloakSpringBootConfigResolver implements org.keycloak.adapters.KeycloakConfigResolver { | ||
|
||
private KeycloakDeployment keycloakDeployment; | ||
|
||
private static AdapterConfig adapterConfig; | ||
|
||
@Override | ||
public KeycloakDeployment resolve(HttpFacade.Request request) { | ||
if (keycloakDeployment != null) { | ||
return keycloakDeployment; | ||
} | ||
|
||
keycloakDeployment = KeycloakDeploymentBuilder.build(KeycloakSpringBootConfigResolver.adapterConfig); | ||
|
||
return keycloakDeployment; | ||
} | ||
|
||
static void setAdapterConfig(AdapterConfig adapterConfig) { | ||
KeycloakSpringBootConfigResolver.adapterConfig = adapterConfig; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
...ing-boot/src/main/java/org/keycloak/adapters/springboot/KeycloakSpringBootProperties.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package org.keycloak.adapters.springboot; | ||
|
||
import org.keycloak.representations.adapters.config.AdapterConfig; | ||
import org.springframework.boot.context.properties.ConfigurationProperties; | ||
|
||
@ConfigurationProperties(prefix = "keycloak", ignoreUnknownFields = false) | ||
public class KeycloakSpringBootProperties extends AdapterConfig { | ||
|
||
} |