Skip to content

Commit

Permalink
Merge pull request #10 from openstandia/dev
Browse files Browse the repository at this point in the history
fix: can't update client role's name correctly
  • Loading branch information
wadahiro authored Aug 29, 2022
2 parents 261bc9c + 2de53ef commit 0b0dd1d
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 0b0dd1d

Please sign in to comment.