Configure unique attributes¶
WSO2 Identity Server can be configured to retain the uniqueness of user attributes. This allows you to keep a user attribute value as a unique value within or across all userstores.
Follow the steps below to configure:
-
Open the
deployment.toml
file in the<IS_HOME>/repository/conf
folder and add the following configurations.[identity_mgt.user_claim_update.uniqueness] enable = true scope_within_userstore = false # Optional.
Note
To keep the uniqueness within a userstore, set
scope_within_userstore
astrue
. -
Restart the WSO2 Identity Server.
- On the WSO2 Identity Server Console, go to User Attributes & Stores > Attributes.
- Click Attributes to see the list of attributes.
- Click Edit for the attribute you want to update.
-
Go to the Additional Properties tab and add the following property to configure the attribute's uniqueness.
Property Name Property Value isUnique true -
Finally, click
+
button andUpdate
to save the additional property.
You can now verify the functionality by attempting to add users with an existing attribute value or updating the user attribute value of an existing user.