KEYCLOAK-1062 Document how to configure listeners
This commit is contained in:
1 parent
545521137d
commit
d44cc8639d
3 files changed
+33
-8
No files matched your search
@@ -5,3 +5,13 @@ To deploy copy target/event-listener-sysout-example.jar to standalone/configurat
|
||||
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" ]
|
||||
}
|
||||
}
|
||||
+3
-3
@@ -24,10 +24,10 @@ public class SysoutEventListenerProviderFactory implements EventListenerProvider
|
||||
|
||||
@Override
|
||||
public void init(Config.Scope config) {
|
||||
String excludes = config.get("excludes");
|
||||
String[] excludes = config.getArray("excludes");
|
||||
if (excludes != null) {
|
||||
excludedEvents = new HashSet<EventType>();
|
||||
for (String e : excludes.split(",")) {
|
||||
excludedEvents = new HashSet<>();
|
||||
for (String e : excludes) {
|
||||
excludedEvents.add(EventType.valueOf(e));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user