title: Failing to create user with password via Keycloak Rest API
body: <p>I'm trying to migrate users from existing database. Passwords are encrypted with sha512.
  I use Keycloak 10 with the REST API.</p>
  <p>I have read the <a href="https://www.keycloak.org/docs-api/10.0/rest-api/index.html#_credentialrepresentation" rel="nofollow noreferrer">CredentialRepresentation </a> and y Have try put JSON into the strings for attributes <a href="https://github.com/keycloak/keycloak/blob/04415d34eab5ed577c472802df4ca11fbafabc7e/server-spi/src/main/java/org/keycloak/models/credential/dto/PasswordSecretData.java#L10" rel="nofollow noreferrer">secretData</a> and <a href="https://github.com/keycloak/keycloak/blob/04415d34eab5ed577c472802df4ca11fbafabc7e/server-spi/src/main/java/org/keycloak/models/credential/dto/PasswordCredentialData.java#L6" rel="nofollow noreferrer">credentialData</a>.</p>
  <p>My post user (with correct Authorization) return &quot;error&quot;: &quot;unknown_error&quot;.</p>
  <pre><code>POST &lt;someDomain&gt;/auth/admin/realms/assure/users
  {
  &quot;firstName&quot;: &quot;test_encrypte&quot;,
  &quot;lastName&quot;:&quot;test_encrypte&quot;, 
  &quot;email&quot;:&quot;jeremy.rafflin@mail.fr&quot;, 
  &quot;credentials&quot;: [{
      &quot;type&quot;:&quot;password&quot;,
              &quot;credentialData&quot; : &quot;{\&quot;value\&quot;:\&quot;fdVjg7Ed/dck1eSGobCHG4JtObyE3BNE3xZhCuuJ0PpmGB4d/OO+t0C5PwYhtOnUV++X2Jh0xmNdNu+sTkt4Bw==\&quot;,\&quot;salt\&quot;:\&quot;98cj35ZuYZR7S6N.MvZ2lA/UYfWAztXfF.nm/hFIQso\&quot;}&quot;,
      &quot;secretData&quot;: &quot;{\&quot;algorithm\&quot;:\&quot;sha512\&quot;,\&quot;hashIterations\&quot;:1}&quot;
  }],
  &quot;username&quot;:&quot;encrypt&quot;,
  &quot;emailVerified&quot;: false,
  &quot;enabled&quot;: true,
  &quot;attributes&quot;: {&quot;assureId&quot;:&quot;10406440&quot;}
  }
  </code></pre>
  <p>I using keycloak standalone.</p>
  <p><a href="https://i.stack.imgur.com/B4m8X.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/B4m8X.png" alt="My request" /></a></p>