Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Keycloak Admin Rest API unknown_error for update user API

I am trying to add a custom attribute to a user using Admin Rest API. When i try with default master realm, its working fine. But when i try it with another realm that i created, it yields "unknown_error".

I have attached the screenshot of request below. enter image description here

like image 279
Muhammad Umair Avatar asked Dec 01 '22 13:12

Muhammad Umair


2 Answers

You haven't granted related permissions to your realm.

Go to 'Clients' -> select your client -> 'Service Account Roles':

  • In the client roles dropdown box, click realm-management
  • In Available Roles box, select related roles. Try manage-users and view-users.

Then get a new access token and try your API call again.

enter image description here

like image 152
Stephen Avatar answered Mar 16 '23 13:03

Stephen


Apparently the Admin API needs to be accessed via the admin-cli client.

I got a 403 {"error":"unknown_error"} when I wanted to use a copy of the default admin-cli client.

like image 24
martn_st Avatar answered Mar 16 '23 14:03

martn_st