getting 404 error when creating user for keycloak programatically using java
The following is my code for creating user
Keycloak keycloack = Keycloak.getInstance("url", "realm", "username", "password"); RealmResource realmResource = keycloack.realm("realm"); UsersResource userResource = realmResource.users(); CredentialRepresentation credential = new CredentialRepresentation(); credential.setType(CredentialRepresentation.PASSWORD); credential.setValue("test123"); UserRepresentation userRepresentation = new UserRepresentation(); userRepresentation.setUsername(user.getUsername()); userRepresentation.setFirstName(user.getFirstName()); userRepresentation.setLastName(user.getLastName()); userRepresentation.setEmail(user.getEmailId()); userRepresentation.setEnabled(true); credential.setTemporary(false); // userRepresentation.setCredentials(Arrays.asList(credential)); userResource.create(userRepresentation);
I am getting a 404 error on reaching the create method