Symfony2 custom Password Encoder (bcrypt)

前端 未结 3 630
谎友^
谎友^ 2021-02-05 19:49

I\'ve written my own password encoder which implements the PasswordEncoderInterface:

class BCryptPasswordEncoder implements PasswordEncoderInterface         


        
3条回答
  •  萌比男神i
    2021-02-05 20:09

    As of November 2011, before Symfony 2.2, this is not directly supported.

    Instead of reinventing the wheel, I suggest you to use the Blowfish Password Encoder bundle I wrote (ElnurBlowfishPasswordEncoderBundle), which solves the same problem. Or, at least, you can see how it's implemented.

    If you're using Symfony 2.2 or later, see Seldaek's answer for configuration instructions.

提交回复
热议问题