Add new user by java api with own id - problem

I am trying to add new user to keycloak by java api. I am using UserRepresentation.class witch has method setId(), but it doesn’t work. What do I wrong?

When you create a new User, the ID is set by Keycloak. You cannot control this value.

so for what is method setId() in UserRepresentation?

My guess is they use the same UserRepresentation class when creating the response on the server, which they need a setId() method for.

It might make sense:slight_smile: