This repository contains the Keycloak Unique Attribute Validator Provider, designed to enhance your Keycloak instance by enabling the validation of unique attributes for user profiles. Below are the steps to set up and use this provider in your Keycloak environment.
Before you begin, ensure that the User Profile
feature is enabled in Keycloak. By default, this feature is not active. To enable it, you must start Keycloak with a specific feature flag.
To enable the User Profile
feature:
- Run Keycloak with the
--features=declarative-user-profile
flag. This setting is already included in thedocker-compose
file provided with this repository. - Start the project using the following command:
docker compose up -d
- Once the Keycloak instance is up and running, navigate to the admin console.
- Go to the Keycloak admin console.
- Log in using the credentials:
- Username: admin
- Password: admin
- Select your realm.
- In the realm, navigate to
Realm Settings -> General
. - Enable
User Profile Enabled
.
After enabling the User Profile feature:
- Go to
Realm Settings -> User Profile
. - Add your attribute to the profile.
- Add the validator named
unique-attribute
.
Once these steps are completed, your Keycloak instance will be configured to validate unique attributes in user profiles, using the Unique Attribute Validator Provider.
If you encounter any issues or have questions, please file an issue in this repository's issue tracker.