简体   繁体   English

如何使用Google OAuth作为Symfony2 Rest API的增强

[英]How to use Google OAuth as autentification for Symfony2 Rest API

I am working on SPA and HTML5 Mobile application that's consume my server application via rest api. 我正在研究SPA和HTML5移动应用程序,这些应用程序通过rest api使用了我的服务器应用程序。 Server app connects to Google Adwords Api and then sending data to client app. 服务器应用程序连接到Google Adwords Api,然后将数据发送到客户端应用程序。 My question is: is it possible to use google oauth login as login for my server api. 我的问题是:是否可以使用google oauth登录名作为我的服务器api的登录名。 And how? 如何?

Do I need to use FOSOAuthServerBundle? 我需要使用FOSOAuthServerBundle吗?

Best, Antonio 最好,安东尼奥

This is the flow for this use case: https://developers.google.com/+/web/signin/server-side-flow 这是此用例的流程: https : //developers.google.com/+/web/signin/server-side-flow

And after this you can use google token as your api token, or build your own oauth and use your own token. 之后,您可以使用Google令牌作为您的api令牌,或者构建自己的oauth并使用自己的令牌。

Also it is possible to use FOSOAuthServerBundle with custom grant 也可以将FOSOAuthServerBundle与自定义授予一起使用

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM