0

我需要随机盐来与文件 security.yml 中的用户而不是数据库中的用户进行哈希密码。我需要在“编码器”部分声明什么才能在密码散列中使用盐?

4

1 回答 1

0

I think you shoud implement your own encoder logic by providing a service

services:
   custom_encoder:
       class: Acme\TestBundle\Service\CustomEncoder

It must implement Symfony\Component\Security\Core\Encoder\PasswordEncoderInterface

After that add this class to security.yml

security:
   encoders:
      Acme\TestBundle\Entity\User:
         id: custom_encoder
于 2012-04-04T07:11:26.430 回答