Custom Local Auth against existing user database using old md5 hash

System Information
  • Strapi Version: 4.1.5
  • Operating System: Ubuntu
  • Database: Postgresql
  • Node Version: 14.19.1

Is there a way I can customize the login process so that it uses existing user data on the first log in?

I want to upgrade an existing system, the original system had an MD5 hashed password database, so the original passwords cannot be retrieved.

My initial concept is that when existing users authenticate for the first time on the new system, the password can be checked against the old password hash, in order to validate their credentials, and if the validation is passed then the password is stored in the new password format Strapi sets in the normal user database.

So my questions are:

Is this possible to achieve in the first place?

And if so, could anybody please give me pointers as to how I could go about doing this?

Any help will be kindly appreciated.