Realtime input validation and custom registration fields
Last updated
Was this helpful?
Last updated
Was this helpful?
In reality the regexp used in this gif doesn't work server side, the regexp pattern should be ^[^@]@gmail\.com$
(the RegExp should match the whole string) 😬.
User Profile is a Keycloak feature that enables to , what information you want to collect on your users in the register page and to validate inputs !
Keycloakify provides client side validation out of the box but for customizing the registration experience you'll have customize register-user-profile.ftl
Example in the starter project:
This limitation means that we can't provide immediate feedback to the user on the client side about the validity of their chosen password. Only after the user clicks on 'Register' will they receive an error if the chosen password does not adhere to the server-defined password policy.
If you register you'll see that you have to select if your are a cat or dog person.
This appear because, on my keycloak server I have configured a custom user profile attribute.
And when the user is connecte, it's choice appear in the JWT
This work because I have created the following mapper in my Keycloak configuration pannel:
Name: Favourite pet
Mapper type: User attribute
User attribute: favourite_pet
Token claim name: favourite_pet
Claim JSON type: string
You can establish guidelines for what constitutes a valid password, such as a minimum length, by utilizing the Keycloak Admin UI under 'Authentication -> Password Policy'. However, as of now, .
Should you insist on implementing client-side password validation, , although it's not typically recommended. The reason for this is potential confusion for users if the validator defined in your theme does not align with the server's password policy.
In .
Go to clients -> -> Mappers