Symfony2 中的 OpenID 与 FOSUserBundle
我正在尝试在此项目的基础上将 openID 与 FOSUserBundle 集成: 不幸的
是,其中存在错误。其中一个是配置问题(对于想要尝试的人来说): src/SC/UsersBundle/Resources/config/routing/security.xml 中的第 8 行应为 SCUsersBundle:Security:login
这暗示该项目从未完成。解决后,我得到“SQLSTATE[23000]:违反完整性约束:1048列'电子邮件'不能为空” 这似乎是由于 User 对象是序列化的,并且由于某种原因 FOSUserBundle 在“序列化”方法中不包含电子邮件。
之后,以及一些其他属性被包含到重写方法(包括“id”)中,系统仍然希望创建一个新条目,而不是更新现有条目。
有什么想法吗?
I am trying to integrate openID with the FOSUserBundle on the basis of this project:
http://symfony2bundles.org/diegogd/fosuser-fpopenid
Unfortunately, there them to be errors. One was a configuration issue (for the people who want to try):
Line 8 in src/SC/UsersBundle/Resources/config/routing/security.xml should read
SCUsersBundle:Security:login
That hints that the project was never completed. After that is solved, I get "SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'email' cannot be null"
This seems to be due to the fact that the User object is serialized and for some reason the FOSUserBundle does not include email in the "serialize" method.
After that and some other properties are included into an overriding method (including "id"), the system still wants to create a new entry instead of updating the existing one.
Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在 FOSUserBundle 的 InteractiveLoginListener 中反序列化用户对象时出现问题。现在,您可以手动设置安全令牌并将用户重定向到另一个页面,而不是将其发送回 fos_user_security_check。
例如,不要这样做:
执行以下操作:
其中“authenticated_user_dashboard”是您希望用户最终访问的任何内部登录页面。
请注意,由于未调用 FOSUserBundle 的 InteractiveLoginListener::onSecurityInteractiveLogin(),因此不会自动更新上次登录时间。
这是 makasim 正在调查的已知问题:https://github.com/formapro/FpOpenIdBundle/issues /5
There is a problem with unserializing user objects in FOSUserBundle's InteractiveLoginListener. For now you can manually set the security token and redirect users to a another page rather than sending them back to fos_user_security_check.
For example, instead of this:
Do this:
Where "authenticated_user_dashboard" is whatever internal landing page you want users to end up on.
Note that because FOSUserBundle's InteractiveLoginListener::onSecurityInteractiveLogin() is not called, last login time will not be updated automatically.
This is a known issue that makasim is investigating: https://github.com/formapro/FpOpenIdBundle/issues/5
master 分支包含该问题的修复
The master branch contains fixes for the issue