Update doPreSetUserClaimValue listener
@@ -96,8 +96,19 @@ public class UniqueClaimUserOperationEventListener extends AbstractIdentityUserO
if (!isEnable()) {
return true;
}
+ String tenantDomain;
+ try {
+ tenantDomain = UniqueClaimUserOperationDataHolder.getInstance().getRealmService().getTenantManager().
+ getDomain(userStoreManager.getTenantId());
+ if (isUniqueClaim(claimURI, tenantDomain)) {
return !isClaimDuplicated(userName, claimURI, claimValue, profile, userStoreManager);
}
+ } catch (org.wso2.carbon.user.api.UserStoreException | ClaimMetadataException e) {
+ log.error("Error while retrieving details. " + e.getMessage(), e);
+ return false;
+ }
+ return true;
+ }
@Override
public boolean doPreSetUserClaimValues(String userName, Map<String, String> claims, String profile,
