I want to update the user detail. e.g. I created user(k1) in "demo" realm from keycloak admin console. I have one java client and I want to update the user(k1) details like. Change Email address of user k1.
I did using Admin client(Rest API) as below.
public void updateEmail(final String newEmailAddress) { try { final AccessToken accessToken = getToken(); Keycloak keycloak = KeycloakBuilder.builder().serverUrl(this.getDeployment().getAuthServerBaseUrl()) .realm(this.getDeployment().getRealm()).username("k1").password("123").clientId(ADMIN_CLIENT) .resteasyClient(new ResteasyClientBuilder().connectionPoolSize(10).build()).build(); UserResource userResource = keycloak.realm(this.getDeployment().getRealm()).users() .get(accessToken.getSubject()); UserRepresentation user = userResource.toRepresentation(); user.setEmail(newEmailAddress); userResource.update(user); } catch (Exception exception) { exception.printStackTrace(); }}But I want do the same without using Admin client.