diff --git a/components/org.wso2.carbon.identity.scim2.common/src/main/java/org/wso2/carbon/identity/scim2/common/impl/SCIMUserManager.java b/components/org.wso2.carbon.identity.scim2.common/src/main/java/org/wso2/carbon/identity/scim2/common/impl/SCIMUserManager.java index 466d85bc..ff883281 100644 --- a/components/org.wso2.carbon.identity.scim2.common/src/main/java/org/wso2/carbon/identity/scim2/common/impl/SCIMUserManager.java +++ b/components/org.wso2.carbon.identity.scim2.common/src/main/java/org/wso2/carbon/identity/scim2/common/impl/SCIMUserManager.java @@ -5414,15 +5414,22 @@ private void updateUserClaims(User user, Map oldClaimList, } // Update user claims. - userClaimsToBeModified.putAll(userClaimsToBeAdded); - if (MapUtils.isEmpty(simpleMultiValuedClaimsToBeAdded) && - MapUtils.isEmpty(simpleMultiValuedClaimsToBeRemoved)) { - // If no multi-valued attribute is modified. - carbonUM.setUserClaimValuesWithID(user.getId(), userClaimsToBeModified, null); - } else { - carbonUM.setUserClaimValuesWithID(user.getId(), convertClaimValuesToList(oldClaimList), - simpleMultiValuedClaimsToBeAdded, simpleMultiValuedClaimsToBeRemoved, - convertClaimValuesToList(userClaimsToBeModified), null); + try { + // The new claim list can be help full for downstream tasks like outbound provisioning. + IdentityUtil.threadLocalProperties.get().put("newClaimList", newClaimList); + userClaimsToBeModified.putAll(userClaimsToBeAdded); + if (MapUtils.isEmpty(simpleMultiValuedClaimsToBeAdded) && + MapUtils.isEmpty(simpleMultiValuedClaimsToBeRemoved)) { + // If no multi-valued attribute is modified. + carbonUM.setUserClaimValuesWithID(user.getId(), userClaimsToBeModified, null); + } else { + carbonUM.setUserClaimValuesWithID(user.getId(), convertClaimValuesToList(oldClaimList), + simpleMultiValuedClaimsToBeAdded, simpleMultiValuedClaimsToBeRemoved, + convertClaimValuesToList(userClaimsToBeModified), null); + } + } + finally { + IdentityUtil.threadLocalProperties.get().remove("newClaimList"); } }