symfony2 / fos-user-bundle:如果用户类中的salt为空,那么错误的凭据会起作用,但为什么呢?

时间:2013-05-31 12:50:51

标签: symfony fosuserbundle

我按照安装说明安装了fosUserBundle。 一切顺利。

使用命令行我将用户存储在数据库中

登录“demo”密码“demo”

不幸的是我无法登录。

我在日志文件中找到了数据库选择。但是我在修改指令时看不到什么错误。

[2013-05-31 14:35:31] doctrine.DEBUG: SELECT t0.username AS username1, t0.username_canonical AS username_canonical2, t0.email AS email3, t0.email_canonical AS email_canonical4, t0.enabled AS enabled5, t0.salt AS salt6, t0.password AS password7, t0.last_login AS last_login8, t0.locked AS locked9, t0.expired AS expired10, t0.expires_at AS expires_at11, t0.confirmation_token AS confirmation_token12, t0.password_requested_at AS password_requested_at13, t0.roles AS roles14, t0.credentials_expired AS credentials_expired15, t0.credentials_expire_at AS credentials_expire_at16, t0.id AS id17, t0.firstname AS firstname18, t0.lastname AS lastname19, t0.mail AS mail20, t0.url AS url21 FROM fos_user t0 WHERE t0.username_canonical = ? LIMIT 1 ["demo"] []

[2013-05-31 14:35:31] security.INFO: Authentication request failed: Bad credentials [] []

[2013-05-31 14:35:31] security.DEBUG: Redirecting to /login [] []

更新:

如果盐是空的,它会起作用。我不知道为什么。如果我可以使用安全功能,那就太好了。

/** * Get salt * * @return string */ public function getSalt() { return ''; }

0 个答案:

没有答案