com.canoo.dp.impl.server.security.DolphinKeycloakConfigResolver Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of dolphin-platform-security-server Show documentation
Show all versions of dolphin-platform-security-server Show documentation
The Dolphin Platform is a framework that implements the presentation model pattern and provides amodern way to create enterprise applications. The Platform provides several client implementations that all canbe used in combination with a general sever API.
package com.canoo.dp.impl.server.security;
import org.keycloak.adapters.KeycloakConfigResolver;
import org.keycloak.adapters.KeycloakDeployment;
import org.keycloak.adapters.KeycloakDeploymentBuilder;
import org.keycloak.adapters.spi.HttpFacade;
import org.keycloak.representations.adapters.config.AdapterConfig;
public class DolphinKeycloakConfigResolver implements KeycloakConfigResolver {
private static KeycloakConfiguration configuration;
public KeycloakDeployment resolve(final HttpFacade.Request request) {
//keycloak.auth-server-url=http://localhost:8180/auth
//keycloak.realm=canoo
//keycloak.public-client=true
//keycloak.resource=product-app
AdapterConfig adapterConfig = new AdapterConfig();
adapterConfig.setRealm(configuration.getRealmName());
adapterConfig.setAuthServerUrl(configuration.getAuthEndpoint());
adapterConfig.setPublicClient(true);
adapterConfig.setResource(configuration.getApplicationName());
return KeycloakDeploymentBuilder.build(adapterConfig);
}
public static void setConfiguration(KeycloakConfiguration configuration) {
DolphinKeycloakConfigResolver.configuration = configuration;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy