# Keycloak 19.0.2 Creation user with hash password

**URL:** <https://forum.keycloak.org/t/keycloak-19-0-2-creation-user-with-hash-password/17646>\
**Category:** Miscellanaeous\
**Tags:** admin-rest\
**Created:** [September 28, 2022, 5:39pm UTC](https://forum.keycloak.org/t/keycloak-19-0-2-creation-user-with-hash-password/17646 "2022-09-28T17:39:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![viglu](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/viglu/32/6655_2.png) [@viglu](https://forum.keycloak.org/u/viglu)\
**Post date:** [September 28, 2022, 5:39pm UTC](https://forum.keycloak.org/t/keycloak-19-0-2-creation-user-with-hash-password/17646/1 "2022-09-28T17:39:48Z")

</div>

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:

```auto
final CredentialRepresentation credential = new CredentialRepresentation();
        credential.setType("phppass"); 
        credential.setTemporary(false);                        
        credential.setValue(myHash);

```

```auto
 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.
