Skip to content

Commit

Permalink
Merge pull request #598 from AnuradhaSK/new-branch
Browse files Browse the repository at this point in the history
Update claim change when old claims don't have value and updated claim set has empty value
  • Loading branch information
AnuradhaSK authored Jan 26, 2025
2 parents 232dc8a + 61fbc3b commit 1fbb7ac
Showing 1 changed file with 7 additions and 0 deletions.
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

0 comments on commit 1fbb7ac

Please sign in to comment.