I have an old Symfony 2 application with fos user that contains passwords encoded with the sha512 algorithm.
I would like after migrating the table users to the new application symfony 4 with fos user 2.1 to be able to modify the password with the algorithm bcrypt when the user is logging with a listener.
It is possible under Symfony to have several encoders but the problem is that we can not duplicate the same encoder with different algorithm like:
encoders:
FOS\UserBundle\Model\UserInterface: sha512
FOS\UserBundle\Model\UserInterface: bcrypt
or with this code, I have this error message:
Unrecognized option "FOS\UserBundle\Model\UserInterface" under "security.encoders.old"
encoders:
old:
FOS\UserBundle\Model\UserInterface:
algorithm: sha512
new:
FOS\UserBundle\Model\UserInterface:
algorithm: bcrypt