I am working on a custom Event Listener SPI for Keycloak. The event listener works; however, I am having issues with getting the details of the UPDATE_PROFILE event type. When using event.getDetails() which should return a Map of the details of the event, it instead returns null.
I am trying to get the details of what fields were updated by the user, their old values, and their new values for auditing purposes.
The code I currently have for trying to log the event details is the following:
logger.info("Got an event of type: {}", event.getType());
logger.info("Event details:");
if (event.getDetails() != null) {
for (String key : event.getDetails().keySet()) {
logger.info("Key: {}, Value: {}", key, event.getDetails().get(key));
}
}
...
switch (event.getType()) {
case UPDATE_PROFILE:
logger.info("User updated his/her profile");
logger.info("UPDATE_PROFILE event details: {}", event.getDetails());
break;
With the above code, after updating the profile, the logs show this:

EDIT: It logs changes only to fields that existed in the base Keycloak theme (email, first name, and last name). Any changes to any of the custom fields we added to our custom theme is when the event details are null and it does not log anything.
Any help is greatly appreciated.