% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1203 100 1103 100 100 52523 4761 --:--:-- --:--:-- --:--:-- 60150
eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSl......
Now, when I try to fetch users count or create users I received an unkown error
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 25 100 25 0 0 6250 0 --:--:-- --:--:-- --:--:-- 6250
{
"error": "unknown_error"
}
I don’t know but i try many scripts to create an user and it did not work. The role manage-users or query-usersare in admin-cli.
It’s likely that the service account for that client doesn’t have the appropriate roles to perform the query on the mylab realm. Go into the admin-cli client in master realm and click on Service Account Roles. Under Client Roles → mylab-realm, make sure you have manage-users, query-users and view-users assigned.
Let us know how it goes if you make those changes.
Since it is unknown which version of keycloak you’re trying to perform the api request, it might be something wrong with the payload you’re sending to the keycloak api (at least that’s the error I get when am sending a wrong payload).
At version 12 exactly on that endpoint keycloak returns just an integer number where you attempting to get a json response depending on your use might fail to parse a JSON.
Otherwise if there was a different approach to this on previous keycloak versions you can search your version and maybe a public postman or other example resources. I do often compare my payloads to KeycloakRestAPI depending if keycloak 12 still persist on same payload references.