Change default registration behavior in Keycloak

We have recently switched to Keycloak to handle the login to our website. It’s still possible to register and Keycloak has a user registration page, but I basically need to change the definition of ‘registrating’. By default it means “insert a new user in the DB with the info given by the user through the registration form”. But that’s not what we want, we already have all the users that CAN register in our DB, and registrating as a user pretty much means updating a record in our DB.

I have already made changes to the a few classes and redeployed them by packaging them and then adding the Jar to the \deployments directory. But I can’t seem to find the classes that I have to change to get the registration page to behave the way I want.

I have tried editing the ‘RegistrationUserCreation’ class, but that did’nt seem to work (what is this class then used for anyway? When is the code in this class triggered?).

How can I change the default behavior of the registration page? What classes do I have to change?