Hi,
I created a provider which can handle phppass. As I need to migrate Wordpress user to keycloak with hash passwords.
The provider seems to work. I can create a user in the interface and can login with it. algorithm set to “phpass” at credential level.
But I need to it in java with keycloak-admin.
Here is my code:
final CredentialRepresentation credential = new CredentialRepresentation();
credential.setType("phppass");
credential.setTemporary(false);
credential.setValue(myHash);
final UserRepresentation user = new UserRepresentation();
user.setEmail(myEmail);
user.setUsername(myUser);
user.setEnabled(true);
user.setEmailVerified(true);
user.setCredentials(Arrays.asList(credential));
keycloakAdmin.realm(myRealm).users().create(user);
The user is created but not the credential and the documentation is not very clear how to use the CredentialRepresentation object.
Has anyone had a similar problem or has an advise?
I really appreciate it if you could help me.