You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Using configuration variables in FreeMarker
#13337
I would like to use Keycloak configuration (e.g. from conf/keycloak.conf or else) in a FreeMarker template. There is a well known way to use system properties or environment variables through the substitution in theme.properties but I didn't find a way to use Keycloak configuration.
I ended up with an ugly custom ThemeSelectorProvider, which adds Keycloak configuration to the system properties:
public class CustomThemeSelectorProvider extends DefaultThemeSelectorProvider {
public CustomThemeSelectorProvider(final KeycloakSession session) {
super(session);
Streams.stream(Configuration.getConfig().getPropertyNames()).filter(n -> n.startsWith("kc.spi-theme-selector-custom"))
.forEach(n -> System.setProperty(n, Configuration.getConfig().getRawValue(n)));
}
}
Is this feature with using Keycloak configuration in FreeMarker template on the roadmap?
Is there a better was to implement the feature in the user space?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Hi folks,
I would like to use Keycloak configuration (e.g. from
conf/keycloak.confor else) in a FreeMarker template. There is a well known way to use system properties or environment variables through the substitution intheme.propertiesbut I didn't find a way to use Keycloak configuration.I ended up with an ugly custom
ThemeSelectorProvider, which adds Keycloak configuration to the system properties:All reactions