keycloak/keycloak-nodejs-admin-client

Role name is deleted after call [Update a role by name]

T-VN opened this issue · 2 comments

T-VN commented

Describe the bug
Role name is deleted after call [Update a role by name]

To Reproduce
Steps to reproduce the behavior:

  1. What API did you use? => Update a role by name
  2. What error message did you see?

a. send PUT request {{server}}auth/admin/realms/{{realm}}/roles/{roleName}

Request body
{
"description": "description",
"composite": false,
"clientRole": false
}
b. send GET request {{server}}auth/admin/realms/{{realm}}/roles/{roleName}

It shows error 404
{
"error": "Could not find role"
}

Expected behavior
Should get Role normally with updated data

Enviroment (please complete the following information):

  • Library Version 5.0

you can fix it by adding the role name to the body of your request:

{
  "description": "description",
  "composite": false,
  "clientRole": false,
  "name": "roleName",
}

It's a bug in keycloak...

    await client.roles.updateByName(
      {name: 'cool-role'},
      {
        name: 'cool-role',
        description: 'cool',
        composite: false,
        clientRole: false,
      },
    );

@T-VN does this solve your problem?