# User Migration with custom hash password

**URL:** <https://community.auth0.com/t/user-migration-with-custom-hash-password/86822>\
**Category:** Get Help\
**Tags:** bulk-user-import, password-hash, user-import\
**Created:** [July 12, 2022, 2:53pm UTC](https://community.auth0.com/t/user-migration-with-custom-hash-password/86822 "2022-07-12T14:53:13Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![spoudel](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/spoudel/32/51376_2.png) [@spoudel](https://community.auth0.com/u/spoudel)\
**Post date:** [July 12, 2022, 2:53pm UTC](https://community.auth0.com/t/user-migration-with-custom-hash-password/86822/1 "2022-07-12T14:53:13Z")

</div>

I am trying to use the import user extension to migrate users from a legacy DB. I am building a json file to migrate the users. I need a little help with custom password hash object. The scenario is:  
The hashing of the password is done with a function that uses a key-phrase to set the Key and IV values of a .NET RijndaelManaged crypto object. The object is set with PKSC7 padding and a cipher mode of CBC. That then hashes the password.  
How should my custom hash object look like in this case? Or is this even a supported algorithm?

---

<div class="post-metadata">

**Author:** ![firmino](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@firmino](https://community.auth0.com/u/firmino)\
**Post date:** [July 12, 2022, 3:15pm UTC](https://community.auth0.com/t/user-migration-with-custom-hash-password/86822/2 "2022-07-12T15:15:17Z")

</div>

Take a look at this migration guide: [Configure Automatic Migration from Your Database](https://auth0.com/docs/manage-users/user-migration/configure-automatic-migration-from-your-database)

And this thread: [Custom password hashing](https://community.auth0.com/t/custom-password-hashing/6725)

---

<div class="post-metadata">

**Author:** ![spoudel](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/spoudel/32/51376_2.png) [@spoudel](https://community.auth0.com/u/spoudel)\
**Post date:** [July 12, 2022, 3:45pm UTC](https://community.auth0.com/t/user-migration-with-custom-hash-password/86822/3 "2022-07-12T15:45:14Z")

</div>

Thanks for the reply. I forgot to mention that I am planning for a Bulk Migration and not Automatic Migration.

---

<div class="post-metadata">

**Author:** ![firmino](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@firmino](https://community.auth0.com/u/firmino)\
**Post date:** [July 12, 2022, 4:55pm UTC](https://community.auth0.com/t/user-migration-with-custom-hash-password/86822/4 "2022-07-12T16:55:19Z")

</div>

Are you open to force users to reset their passwords? If so, you could ditch the old hashes and force the users to reset their passwords on their first login.

---

<div class="post-metadata">

**Author:** ![spoudel](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/spoudel/32/51376_2.png) [@spoudel](https://community.auth0.com/u/spoudel)\
**Post date:** [July 12, 2022, 6:09pm UTC](https://community.auth0.com/t/user-migration-with-custom-hash-password/86822/5 "2022-07-12T18:09:09Z")

</div>

If that is the only option then I don’t think I have a choice.

---

<div class="post-metadata">

**Author:** ![ascendsauce](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ascendsauce/32/38732_2.png) [@ascendsauce](https://community.auth0.com/u/ascendsauce)\
**Post date:** [July 14, 2022, 1:36pm UTC](https://community.auth0.com/t/user-migration-with-custom-hash-password/86822/6 "2022-07-14T13:36:11Z")

</div>

How would you go about forcing users to reset their passwords on first time login? Is this something you can do with Universal login?

---

<div class="post-metadata">

**Author:** ![firmino](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@firmino](https://community.auth0.com/u/firmino)\
**Post date:** [July 14, 2022, 2:43pm UTC](https://community.auth0.com/t/user-migration-with-custom-hash-password/86822/7 "2022-07-14T14:43:02Z")

</div>

Hi, good question.

TL;DR:

_If your application uses Universal Login, the user can use the Lock widget on the Login screen to trigger a password reset email. With the New Universal Login Experience, the user can click the **Don’t remember your password?** link and then enter their email address. This fires off a POST request to Auth0 that triggers the password reset process. The user [receives a password reset email](https://auth0.com/docs/authenticate/database-connections/password-change#password-reset-email)._

Source: [Change Users' Passwords](https://auth0.com/docs/authenticate/database-connections/password-change)

---

<div class="post-metadata">

**Author:** ![ascendsauce](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ascendsauce/32/38732_2.png) [@ascendsauce](https://community.auth0.com/u/ascendsauce)\
**Post date:** [July 14, 2022, 2:59pm UTC](https://community.auth0.com/t/user-migration-with-custom-hash-password/86822/8 "2022-07-14T14:59:23Z")

</div>

Ah, so there is no way to force a user to reset password flow; For instance, if they were unaware that they needed to do a password reset, they would enter a password and get an invalid password error message, presumably multiple times.

---

<div class="post-metadata">

**Author:** ![spoudel](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/spoudel/32/51376_2.png) [@spoudel](https://community.auth0.com/u/spoudel)\
**Post date:** [July 14, 2022, 7:07pm UTC](https://community.auth0.com/t/user-migration-with-custom-hash-password/86822/9 "2022-07-14T19:07:57Z")

</div>

@dan.woda  
@rueben.tiow  
@konrad.sopala  
@ty.frith  
Need help!

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [July 18, 2022, 3:24pm UTC](https://community.auth0.com/t/user-migration-with-custom-hash-password/86822/10 "2022-07-18T15:24:26Z")

</div>

> [@spoudel](#):
>
> I need a little help with custom password hash object.

What have you tried? Are you seeing any errors?

---

<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:** [October 21, 2024, 11:46pm UTC](https://community.auth0.com/t/user-migration-with-custom-hash-password/86822/12 "2024-10-21T23:46:04Z")

</div>

Hi @spoudel,

These are the available algorithms:

- `argon2`
- `bcrypt`
- `hmac`
- `ldap`
- `md4`
- `md5`
- `sha1`
- `sha256`
- `sha512`
- `pbkdf2`
- `scrypt`

(Reference: [Bulk User Import Database Schema and Examples](https://auth0.com/docs/manage-users/user-migration/bulk-user-import-database-schema-and-examples#custom-password-hash))

In this case, I recommend considering an automatic migration over a bulk migration. This way, your users will be prompted to reset their passwords on their first login.

Thanks,  
Rueben

---

<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:** [November 4, 2024, 11:46pm UTC](https://community.auth0.com/t/user-migration-with-custom-hash-password/86822/13 "2024-11-04T23:46:05Z")

</div>

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