I want to call an external REST-API, when a new user has been registered in keycloak. The REST call should create a minimal user entity in my spring backend (which has its own db). When the REST call fails, it should abort the register process, so I can’t miss register events on the spring side.
What I found out was that Keycloak supports custom SPI’s, where I can listen to those kinds of events and act with custom Java code to it. Sounded like a perfect fit for my use case. But after implementing a poc, I noticed that the event is only fired when a registration is done through the register page (Keycloak UI). Since I’m implementing a mobile app, I want to do the registration process through the REST API with my own native UI (Android/iOS).
How I created the user via REST Api: Keycloak REST API: Create a New User - Apps Developer Blog
SPI Code which I followed next to the Keycloak: keycloak-extensions/PlaceholderEventListenerProvider.java at master · zonaut/keycloak-extensions · GitHub
Are these events really only fired when you use the UI or did I miss something?
Thank your very very much for any help !