I'm not working on this plugin anymore, because I think, given the direction Keycloak is taking, it would be better to have this functionality as an external service, outside Keycloak.
I suggest using a plugin like this or this other to send events to that other service, which would handle things better.
After installing the plugin, it should normally create an endpoint UNPROTECTED at <keycloak-server-url>:<port>/realms/<realm>/mailchimp-resource/config
. You can call it to get the current mailchimp configuration.
Because it is not protected, you can POST EndPoint to create a new configuration for mailchimp to send a request. Then configure the plugin on the administration page. Example:
{
"apiKey": "mailchimp-api-key",
"listId": "mailchimp-list-id",
"listenedEvents": [
"LOGIN", "REGISTER"
]
}
As we are working with Keycloak, keep in mind that the events handled by Keycloak are enums imported from org.keycloak.events.EventType
.
You will then have a configuration for a specific domain. That's it. The rest is under the hood.
- Event Listener Provider
- JPA entity provider
- Resource provider
These providers are used to keep the plugin configuration running.