[英]Oauth2 in Symfony2
I'd like to use some APIs, foursquare for example, in my Symfony2 project. 我想在我的Symfony2项目中使用一些API,例如foursquare。 The problem is that instead of the 2 great FOS bundles concerning Twitter/Facebook, I'm not finding anything on OAuth (I tried the EtcPasswdOAuthBundle but did not manage to make it work because of a missing file I guess).
问题是,不是关于Twitter / Facebook的两个伟大的FOS捆绑,我没有在OAuth上找到任何东西(我尝试了EtcPasswdOAuthBundle,但由于我猜错了文件而无法使其工作)。
Moreover, I'd like to make it work with FOSUserBundle. 此外,我想使它与FOSUserBundle一起使用。
So, if you could give me some help, I do not understand how to manage OAuth with Symfony ... 所以,如果你能给我一些帮助,我不明白如何用Symfony管理OAuth ......
Thanks ! 谢谢 !
Two years later, but for all who might step over this link while searching for a solution: 两年后,但是对于所有可能在寻找解决方案时跨过此链接的人:
The new OAuth2 package for client integration in Symfony2 is the HWIOAuthBundle , the KNPLabs is no longer maintained. 用于Symfony2中客户端集成的新OAuth2软件包是HWIOAuthBundle ,不再维护KNPLabs。 - the server pendant is the FOSOAuthServerBundle .
- 服务器挂件是FOSOAuthServerBundle 。
Guzzle is a really good client to do http request with objects. Guzzle是一个非常好的客户端,用对象做http请求。
You can add guzzle-oauth2-plugin to handle OAuth easily. 你可以添加guzzle-oauth2-plugin来轻松处理OAuth。 There is a tutorial if you need help.
如果您需要帮助,可以找一个教程 。
Facebook正在使用OAuth2,我猜你可以轻松制作一个基于FacebookBundle的Foursquare套装。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.