I want Keycloak to fire a script - say startup a docker container - when a user logs in. What is the easiest way to achieve this?
You can implement an event listener, listening to the LOGIN
event which does anything, e.g. sending a message to another system, where the container can be started…
It seems like the only way to do that is custom Java code then?
Using what is built in to Keycloak, yes.
There is an extension we built that allows loading of JS scripts at runtime that can be run as event listener GitHub - p2-inc/keycloak-events: Useful Keycloak event listener implementations and utilities.