I am trying to get and change some specific user (name, surname, email, etc), but my link returns some unknown error. This is my link: http://localhost:8080/admin/realms/space-realm/users
. Can you please explain me what I am doing wrong? Will be very apprecaited.
2 Answers
1 Find master access token URL
In my demo URL,
http://localhost:8180/auth/realms/master/protocol/openid-connect/token
This may help long life of access-token time if you needs to more space time to handle step 3 and 4
2 Get master token
run postman, use #1-4 URL
assign variable in tests tab
access-token variable will be use #3 and #4
var jsonData = JSON.parse(responseBody);
postman.setEnvironmentVariable("access-token", jsonData.access_token);
set the Key in Body tab with x-www-form-urlencoded option
Click Send button
Should be return OK 200 status and see the access token
3 Get space-realm user
I added one user, I will get this user information
In my get user list URL
http://localhost:8180/auth/admin/realms/space-realm/users
Use this variable in Authorization Tab
{{access-token}}
4 Update user properties with 3's user UI
set header
The status should be 204 No Content status
if get user information by id, get this result
with changed properties.

- 5,257
- 2
- 10
- 14
First, you need to get an access token for the service account through client credentials grant type flow that has the required roles to manage users in Keycloak. From the Box keycloak has the following hardcoded in the source code roles that allow doing something like that:
- manage-users
- view-users
- query-users
Second. Perform needed requests to the Admin REST API endpoints of Keycloak - https://www.keycloak.org/docs-api/18.0/rest-api/#_users_resource with the retrieved access token in the Authorization Bearer header to manage the users.

- 1,024
- 7
- 12