I’m using the admin API in Java.
When trying to create a user providing a login, firstName, lastName and password. I get BAD REQUEST error 400. I have configured the keycloak container with DEBUG logging and can see the authentication to the server with the realm-management clientId is successful.
maybe you could provide more information about the command you are executing.
Also take a look in the returning headers, sometimes these also contain more information.
So eventually the solution was:
Create a new user that will be the admin user lets called user-admin
Assign user-admin roles from the realm-management client.
The calls needed to use the admin-cli clientId with the user-admin username and password.
Interesting that using realm-managment clientId and clientSecret didn’t work.