keycloak-scim/examples/providers/event-listener-sysout
Stian Thorgersen 0193c696ab Version bump
2016-01-13 09:20:38 +01:00
..
src/main [KEYCLOAK-392] - Admin audit events 2015-05-03 01:46:52 +05:30
pom.xml Version bump 2016-01-13 09:20:38 +01:00
README.md Fixed missing ':' in the JSON example. 2015-12-08 18:45:25 +01:00

Example Event Listener that prints events to System.out

To deploy copy target/event-listener-sysout-example.jar to standalone/configuration/providers. Alternatively you can deploy as a module by running:

KEYCLOAK_HOME/bin/jboss-cli.sh --command="module add --name=org.keycloak.examples.event-sysout --resources=target/event-listener-sysout-example.jar --dependencies=org.keycloak.keycloak-core,org.keycloak.keycloak-model-api,org.keycloak.keycloak-events-api"

Then registering the provider by editing keycloak-server.json and adding the module to the providers field:

"providers": [
    ....
    "module:org.keycloak.examples.event-sysout"
],

Then start (or restart) the server. Once started open the admin console, select your realm, then click on Events, followed by config. Click on Listeners select box, then pick sysout from the dropdown. After this try to logout and login again to see events printed to System.out.

The example event listener can be configured to exclude certain events, for example to exclude REFRESH_TOKEN and CODE_TO_TOKEN events add the following to keycloak-server.json:

...
"eventsListener": {
    "sysout": {
        "exclude": [ "REFRESH_TOKEN", "CODE_TO_TOKEN" ]
    }
}