Manage user claims uniqueness on the WSO2 Identity server

Chathuranga Priyadarshana
2 min readApr 15, 2021

--

Now you can keep a user claim value as a unique value within all userstors in WSO2 identity server.

As an example, if your admin configure the wso2 IS for keep email-address claim as a unique claim, you can use your abc@wso2.com email address only for one account as the email address. If you try to create another account using abc@wso2.com as email address, it will be restricted by WSO2 IS. and also some one try to update his email address from your abc@wso.com email address it will be also restricted by WSO2 IS.

Configure WSO2 IS to manage user claim uniqueness

Follow the steps below to configure WSO2 Identity Server to keep uniqueness of user claims.

1. Open the deployment.toml file in the <IS_HOME>/repository/conf directory and add the following configuration.

[[event_listener]]

id = “unique_claim_user_operation_event_listener”

type = “org.wso2.carbon.user.core.listener.UserOperationEventListener”

name = “org.wso2.carbon.identity.unique.claim.mgt.listener.UniqueClaimUserOperationEventListener”

order = 2

enable = true

2. Restart WSO2 identity server and access the management console at https://wso2.is/carbon/.

3. From the list of claims, select the claim you want to configure to keep it unique.

Select a claim from claim list

4. Open the claim edit window by clicking the Edit button.

Edit selected claim

5. By clicking Add Claim Property , add an additional claim property as follows.

Property Name : isUnique

Property Value : true

Adding new claim properties

6. Finally click the Update button to save additional claim property.

Now you can check and verify the functionality adding users with existing claim value or update user claim value to existing value.

--

--

Chathuranga Priyadarshana

Software Engineer | BSc Engineering (Hons) in Computer Engineering | University of Peradeniya