I want to change the logic during the update of an account
Some details
I have a custom attribute to hold the phoneNumber of the user
On registration, a FormAction validates the phoneNumber and sends a code to the phone number
I will implement a new endpoint/page for entering the code received by SMS that will set another custom attribute phoneNumberVerified
What I’d like to do is to check the phoneNumber and send a SMS if it changed during the account update
At the moment, the phoneNumber is displayed and the user can change it (this is because I am using a custom attribute)
However, I do not see how I can change the logic to validate the phone number, to set the phoneNumberVerified to false and to send a SMS to the new phoneNumber
I’ve seen Adjust user account update processing but there is not a lot of details (and I would prefer to stay inside keycloak if possible, not creating a 3rd party app)
I’d like to know if the new UserProfile feature is usable in 14.0.0 and if yes if it can cover my use case ?
Otherwise, is it possible to use the EventListener SPI in order to “intercept” the account update ?
at least to know if the phoneNUmber has been changed and, if yes, set phoneNumberVerified to false and re-send a SMS (I know I won’t be able to validate the phone number with this SPI)
Thanks for your time,