Hello,
trying to integrate the Keycloak "server" into my own JAX-RS application
(for the integration with the UnifiedPush Server). I started w/ a simple
app.
Generally I am doing something similar to what the LiveOak folks do:
I create leverage the Admin realm, using Java APIs:
https://github.com/liveoak-io/liveoak/blob/master/modules/keycloak/src/ma...
Now, to get rid of the 'keycloak.json' file for the AS7 adapter, I tried
the following, inside of the constructor of my JAX-RS Application class
(which extends KeycloakApplication):
....
final AdapterConfig config = new AdapterConfig();
config.setRealm(adminRealm.getName());
config.set......
......
final ObjectMapper om = new ObjectMapper();
String json = null;
try {
json = om.writeValueAsString(config);
} catch (IOException e) {
e.printStackTrace();
}
servletContext.setInitParameter(AdapterConstants.AUTH_DATA_PARAM_NAME,
json);
....
However, that happens too late (a ServletContextListener is too late as
well). This line of code:
https://github.com/keycloak/keycloak/blob/master/integration/as7-eap6/ada...
is invoked before the constructor of my JAX-RS Application class (which
extends KeycloakApplication); same with a context listener.
I am wondering what's the best way to provide the "keycloak.json" content,
using Java APIs ?
Greetings,
Matthias
--
Matthias Wessendorf
blog:
http://matthiaswessendorf.wordpress.com/
sessions:
http://www.slideshare.net/mwessendorf
twitter:
http://twitter.com/mwessendorf