Skip to content

Commit

Permalink
update claim change addition when old claims don't have value and upd…
Browse files Browse the repository at this point in the history
…ated claim set has empty value
  • Loading branch information
AnuradhaSK committed Jan 26, 2025
1 parent 232dc8a commit 61fbc3b
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 61fbc3b

Please sign in to comment.