Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the user updated claim list for thread local to be used by downstream tasks #571

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5414,15 +5414,22 @@ private void updateUserClaims(User user, Map<String, String> 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");
}
}

Expand Down
Loading