FOSFacebookBundle 和 FOSUserBundle 协同工作
我正在使用 Symfony2 开发一个网站。
我成功安装了 FOSUserBundle。现在我想安装 FOSFacebookBundle,以便它可以与 FOSUserBundle 一起使用。
我不太理解整个“提供商用户”的事情。在 FOSFacebookBundle 文档中,它说“7. 可以选择定义一个自定义用户提供程序类并将其用作提供程序或定义登录路径”,我应该这样做以使两个包相互协作吗?那是做什么用的?
我想让这两个人互相合作。
I'm developing a website with Symfony2.
I installed FOSUserBundle successfully. Now I would like to install FOSFacebookBundle so that it will work with FOSUserBundle.
I don't really understand the whole "provider user" thing. In the FOSFacebookBundle documentation it says "7. Optionally define a custom user provider class and use it as the provider or define path for login", should I do that to make the two bundles work with each other ? What is that for?
I want to make those two work with each other.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我最近参与了一个项目,其中包含了这两个包。用户提供者只是一个负责检查身份验证数据的类。假设您有一家商店,客户应该能够登录,因此您必须定义一个用户提供程序来处理存储在本地数据库中的客户实体。
但就您而言,您拥有应该能够登录的 Facebook 用户。因此,您定义一个可以处理这些类型用户的用户提供程序(在 FosFacebookBundle 的帮助下)。
这真的很简单。请参阅下面的“使用 FOS\UserBundle 的示例自定义用户提供程序”一章。您只需将其复制并粘贴到您自己的包中即可。
i recently worked on a project in which i included these two bundles. A user provider is just a class that is responsible for checking auth data. Let's say you have a shop and customers should be able to login, so you have to define a user provider that handles customer entities that are stored in a local database.
But in your case you have Facebook Users that should be able to login. So you define a user provider that can handle these type of users (with the help of the FosFacebookBundle).
It's really simpel. See "Example Custom User Provider using the FOS\UserBundle" chapter further down. You can just copy and paste it into your own bundle.