Skip to content

Commit

Permalink
fix: can't update client role's name correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
wadahiro committed Aug 29, 2022
1 parent 261bc9c commit 2de53ef
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,16 @@ public void updateClientRole(KeycloakSchema schema, String realmName, Uid uid, S
try {
for (AttributeDelta delta : modifications) {
if (delta.getName().equals(Name.NAME)) {
current.setName(AttributeDeltaUtil.getAsStringValue(delta));
String name = AttributeDeltaUtil.getAsStringValue(delta);
String[] split = name.split("/");

if (split.length != 2) {
throw new InvalidAttributeValueException("Invalid clientRole name format." +
" It must be <clientUUID>/<clientRoleName>. name: " + name);
}

current.setContainerId(split[0]);
current.setName(split[1]);

} else if (delta.getName().equals(ATTR_DESCRIPTION)) {
current.setDescription(AttributeDeltaUtil.getStringValue(delta));
Expand Down

0 comments on commit 2de53ef

Please sign in to comment.