[keycloak-dev] Added KeycloakContext (and updates to JBossLoggingEventListenerProvider)

Stian Thorgersen stian at redhat.com
Wed Apr 15 08:02:43 EDT 2015


I've added KeycloakContext to KeycloakSession. This should help us to not have to pass around things like UriInfo, RealmModel, etc..

I've not refactored much of existing code, we can do that as we go along. In the future get things from KeycloakContext instead of passing it or injecting it. One thing I did was to get rid of the "Flows" stuff which was pretty much gone any ways.

This also provides access to these values for all providers (for example access to cookies within events requested by jboss.org guys, KEYCLOAK-1042).

To test this out I've updated JBossLoggingEventListenerProvider. JBossLoggingEventListenerProvider is now added by default to new realms making it easier to enable log for events. By default success events are logged with debug and error events are logged with warn, this can be changed in keycloak-server.json. To view events enable debug for "org.keycloak.events". If you set "org.keycloak.events" to trace it will also add requestUri and cookies to the log output.

Check out https://github.com/keycloak/keycloak/blob/master/events/jboss-logging/src/main/java/org/keycloak/events/log/JBossLoggingEventListenerProvider.java#L70 for some code ;)


More information about the keycloak-dev mailing list