I have an application which uses Spring Security to authenticate users. Users and hashed/salted passwords are stored in database. Nothing special hele, USER table with username/password fields. The app uses BCryptPasswordEncoder for hashing function. Now I need to migrate some legacy user data to the application. The legacy data passwords are hashed with other hashing function, lets say, MD5. I can insert the legacy data into the same USER table, but then I have password hashed with different hash functions.
How can I configure Spring Security to select appropriate hashing function when authenticating legacy users / new users?
UPDATE
"MigrateUsersPasswordEncoder" wrom here seems an excellent solution for the problem