【问题标题】:symfony2 - multiple encoding password methods with mutiple user providerssymfony2 - 具有多个用户提供程序的多种编码密码方法
【发布时间】:2012-08-30 08:04:59
【问题描述】:

我想用两种不同的编码密码方法链接两个用户提供程序(FosUserBundle 和一个自定义 DB 用户提供程序)

app/config/security.yml

安全: 编码器: FOS\UserBundle\Model\UserInterface: sha512 我的\AuthBundle\模型\用户:sha1 提供者: my_chain_providers: 链: 提供者:[“fos_userbundle”,“db_user”] fos_userbundle: id:fos_user.user_provider.username_email 数据库用户: 推进: 类:我的\AuthBundle\模型\用户 属性:用户名 防火墙: 主要的: 模式:^/ 表单登录: 提供者:my_chain_providers 注销:真 匿名:真实

我的问题:密码的哈希值遵循 fos_user 表中的 $password.'{'.$salt.'}' 和我的自定义 DB 用户提供程序中的 $salt.$password

这个要点https://gist.github.com/1243080 展示了如何自定义 mergePasswordAndSalt 方法,但是每个用户提供程序是否可以有一个 mergePasswordAndSalt 方法?

【问题讨论】:

    标签: security symfony symfony-2.1


    【解决方案1】:

    您应该将多个编码器与FOSAdvancedEncoderBundle 结合使用。我遇到了同样的问题,并且回答得很周到over here

    【讨论】:

      猜你喜欢
      • 2023-03-22
      • 1970-01-01
      • 2011-09-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-06-20
      • 2020-08-29
      • 1970-01-01
      相关资源
      最近更新 更多