Username validation when updating profile


I currently need to validate the values passed in when editing ones own user profile (first name, last name, e-mail and especially username).
I already validate the username on account registration by implementing the Form Action SPI which gives me the opportunity to do some flexible validations.
However, I couldn’t find a specific way to do that for account updates.
I read something about a Validator SPI and a User Profile SPI (UserProfile and UserProfileProvider seem to exist) but there is literally no documentation on how to work with them.
Does anyone know a way on how to do that?

Kind regards,

1 Like

@lus were you able to find an answer to this? Looking to do something similar and running into similar issues. Thanks!

The new User Profile SPI was introduced in Keycloak 14, documentation has evolved since that. It’s still in preview, but works reliable. I already moved one customer to the new User Profile. Built-in validation options might be a bit limited, but, hey, it’s Keycloak with its SPIs - in doubt, just implement your own validator and you’re good to go!

(post deleted by author)