How to convert sha1() passwords into FOSUserBundle?
问题 I have legacy application that keeps passwords encrypted with sha1() function, no salt. Now that site is being converted into Symfony2 and FOSUserBundle, how can I transfer them to new database? 回答1: i had the same problem just override the encoder like explained by @iamdto # app/config/security.yml security: encoders: FOS\UserBundle\Model\UserInterface: id: your.custom.encoder Your class should be use Symfony\Component\Security\Core\Encoder\PasswordEncoderInterface; class CustomEncoder