# Unable to log in with custom\_password\_hash

**URL:** <https://community.auth0.com/t/unable-to-log-in-with-custom-password-hash/182398>\
**Category:** Get Help\
**Tags:** classic-universal-login-experience, login-experience\
**Created:** [February 18, 2025, 10:06pm UTC](https://community.auth0.com/t/unable-to-log-in-with-custom-password-hash/182398 "2025-02-18T22:06:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![capndave](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/capndave/32/60163_2.png) [@capndave](https://community.auth0.com/u/capndave)\
**Post date:** [February 18, 2025, 10:06pm UTC](https://community.auth0.com/t/unable-to-log-in-with-custom-password-hash/182398/1 "2025-02-18T22:06:31Z")

</div>

We created a user in the Import/Export extension. When I try to log in with my username and password, I get a “verification failed for the provided custom\_password\_hash” error. Is there a limit on the number of rounds supported for the sha512 algorithm, similarly to what’s mentioned [here](https://community.auth0.com/t/migrating-users-from-a-sha256-password/103271/7)? Anything else it could be?

Python used to generate the JSON:

```auto
password = "$6$rounds=656000$.F62OVVCvG7f/Q.n$GKZL5NnA5M0ZderSL8ZOl3eI9kkG/j7MRllpZEoSenC3P8W3qIL9j85oB.ophFW9QnPgtc8fYpuRymYukx2KH." # Original hash from passlib
split = password.split("$")
rounds = split[2].split("=")[1]

# Convert salt to base64 since I saw that in auth0 message boards
# I tried it without doing this and I wasn't able to import the record
salt = split[3]
salt_bytes = salt.encode("ascii") # get the hash
salt_base64_bytes = base64.b64encode(salt_bytes)
salt_base64 = salt_base64_bytes.decode("ascii")

# Convert checksum to base64 since I saw that in auth0 message boards
# I tried it without doing this and I wasn't able to import the record
checksum = split[4]
password_bytes = checksum.encode("ascii") # get the hash
password_base64_bytes = base64.b64encode(password_bytes)
password_base64 = password_base64_bytes.decode("ascii")

payload = {
    "email": user["email"],
    "name": user["fullName"],
    "blocked": bool(user["inactive"]),
    "email_verified": False,
    "app_metadata": {
        "user_type": user["userType"],
    },
    "custom_password_hash": {
        "algorithm": "sha512",
        "hash": {
            "value": password_base64,
            "encoding": "base64",
        },
        "salt": {"value": salt_base64, "encoding": "base64"},
    },
}

```

Resulting JSON:

```auto
[
  {
    "email": "my-email@my-email.com",
    "name": "My Name",
    "blocked": false,
    "email_verified": true,
    "app_metadata": { "user_type": "internal" },
    "custom_password_hash": {
      "algorithm": "sha512",
      "hash": {
        "value": "R0taTDVObkE1TTBaZGVyU0w4Wk9sM2VJOWtrRy9qY01SbGxwWkVvU2VuQzNQOFczcUlMOWo4NW9CLm9waEZXOVFuQmd0YzhmWXB1UnltWXVreDJLSC4=",
        "encoding": "base64"
      },
      "salt": { "value": "LkY2Mk9WVkN2RzdmL1Eubg==", "encoding": "base64" }
    }
  }
]

```

Results in Monitor tool in dashboard when I try to log in:

```auto
"details": {
      "error": {
        "message": "Password change required.",
        "reason": "Verification failed for the provided custom_password_hash: {'algorithm':'sha512','hash':{'value':'R0taTDVObkE1TTBaZGVyU0w4Wk9sM...','encoding':'base64'},'salt':{'value':'LkY2Mk...','encoding':'base64'}}"
      }
    },

```

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [February 19, 2025, 2:10am UTC](https://community.auth0.com/t/unable-to-log-in-with-custom-password-hash/182398/3 "2025-02-19T02:10:38Z")

</div>

Hi @capndave,

I understand that you have been encountering the " _Verification failed for the provided custom\_password\_hash_" error.

In these cases, I suggest referring to our [Verification Failed for the Provided custom\_password\_hash](https://community.auth0.com/t/verification-failed-for-the-provided-custom-password-hash/169648) knowledge solution for guidance.

Let me know if you have any follow-up questions.

Thanks,  
Rueben

---

<div class="post-metadata">

**Author:** ![capndave](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/capndave/32/60163_2.png) [@capndave](https://community.auth0.com/u/capndave)\
**Post date:** [February 19, 2025, 2:11pm UTC](https://community.auth0.com/t/unable-to-log-in-with-custom-password-hash/182398/4 "2025-02-19T14:11:29Z")

</div>

@rueben.tiow Does the 10k rounds limit apply that’s mentioned in [the link](https://community.auth0.com/t/migrating-users-from-a-sha256-password/103271/7)?

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [March 5, 2025, 2:12pm UTC](https://community.auth0.com/t/unable-to-log-in-with-custom-password-hash/182398/5 "2025-03-05T14:12:17Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
