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

Update claim change when old claims don't have value and updated claim set has empty value #598

Merged
merged 1 commit into from
Jan 26, 2025
Merged
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 @@ -5508,6 +5508,13 @@ private void updateUserClaims(User user, Map<String, String> oldClaimList,
simpleMultiValuedClaimsToBeAdded.put(key, Arrays.asList(newClaimList.get(key).split(separator)));
}
}
/*
If the newClaimList has a claim with empty value and the claim is not exist in the oldClaimList, remove that
claim from newClaimList.
*/
newClaimList.entrySet()
.removeIf(entry -> entry.getValue().isEmpty() && !oldClaimList.containsKey(entry.getKey()));

/*
Prepare user claims expect multi-valued claims to be added, deleted and modified.
Remove simple multi-valued claims URIS from existing claims and updated user's claims.
Expand Down
Loading