如何实现身份验证作为Web服务(Symfony2中,REST) [英] How to implement Authentication as a Web Service (Symfony2, REST)

查看:187
本文介绍了如何实现身份验证作为Web服务(Symfony2中,REST)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望有人能够帮助这一点:

I hope someone could help with this:

我工作的一个PHP项目,我需要实现应用程序作为服务的身份验证。我需要做一些像谷歌,其中提供了一个服务于使用谷歌的身份验证服务的其他应用程序登录(例如trello.com允许游客与他们的谷歌帐户登录)。

I am working on a php project and I need to implement the authentication of the application as a Service. I need to do something like Google where offers a Service to login in other applications using Google's Authentication Service (for example trello.com allows visitors to login with their google account).

我想澄清我的脑海里,因为我不知道如何来启动它。我使用Symfony2的框架,我想REST风格工作,但基本上是我需要的只是什么,我必须做或调查,从事这项运动的想法。

I would like to clarify my mind, because I have no idea how to start it. I am using Symfony2 framework and I'm trying to work RESTFully, but basically what I need is just an idea of what I have to do or investigate to carry this out.

推荐答案

因为symfony生态系统大,看看在的 FOSRestBundle 用于创建API。再有就是 NelmioApiDocBundle 为您的REST的API轻松文档。对于身份验证,你应该考虑的OAuth,所以来看看的 FOSOAuthServerBundle 。与所有三个结合,您可以创建一个伟大的API。

As the symfony Ecosystem is big, take a look at the FOSRestBundle for creating the API. Then there is the NelmioApiDocBundle for easy documentation of your REST-API. For authenticating you should consider OAuth, so take a look at the FOSOAuthServerBundle. With all three combined you can create a great API.

另外阅读这篇文章,了解 REST与Symfony2中的API:正确的方式

Also read this article, about REST APIs with Symfony2: The Right Way

这篇关于如何实现身份验证作为Web服务(Symfony2中,REST)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆