by reading other posts here and the documentation I only found the following options to add validation to the username field:
- Extending the theme (FTL or React) to perform a Regex pattern match on the field
- Writing a custom module extending the built-in validation method
The first option does not sound ideal, as someone could likely just craft their own HTTP request and submit the registration without the rendered form.
The second option seems to be a bit overkill, as I wouldn’t only need to write the module, but additionally need to maintain it to keep working with future Keycloak updates.
Do I have any other options to add basic username validation to the registration process?
I do not need validation in other places (i.e. I don’t mind if administrators are allowed to add users with arbitrary characters in the backend), but want the registration process that is exposed to the end user to block usernames with a specified set of characters.
Thanks for any ideas!