我按照安装说明安装 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 '';
}