App Engine 作为 OAuth2 提供者

huangapple go评论90阅读模式
英文:

App Engine As OAuth2 Provider

问题

据我了解,App Engine应用默认情况下是OAuth 1提供者。

是否有办法同时使用OAuth2,例如使用Google+登录或(mobile) chrome.identity API,并仍然利用GAE用户API,而不必实现自定义提供者?

如果不可能,有哪些替代方案?

英文:

As I understand, App Engine Apps are OAuth 1 providers by default.

Is there a way to use OAuth2, e.g. with Google+ Sign-In or (mobile) chrome.identity API while still taking advantage of the GAE Users API and not having to implement a custom provider?

If not possible, what are the alternatives?

答案1

得分: 0

关于你所提到的"(mobile) chrome.identity API",我无法提供任何信息,但是,鉴于我通过它的google-chrome-app标签找到了你的问题,我可以回答关于Chrome应用的问题:是的,可以使用chrome.identity API连接到OAuth1服务器(我已经做过),但这需要很多工作,并且你需要处理所有的OAuth1握手过程。相比没有使用chrome.identity,这种方法要简单一些,但是与连接到OAuth2服务器相比,仍然不太容易,因为后者几乎是自动完成的。

请注意,这不是使用OAuth2进行连接的方式,这是你字面上所问的。相反,这是使用chrome.identity(用于Chrome应用)连接到OAuth1服务器的一种方式。

英文:

Can't say anything about what you refer to as "(mobile) chrome.identity API," but, inasmuch as I got to your question because of its google-chrome-app tag, I can answer for a Chrome App: Yes, it's possible to use the chrome.identity API to connect to an OAuth1 server (I've done it), but it's a lot of work, and you have to horse around with all of the OAuth1 handshaking. It's somewhat easier than trying to connect without chrome.identity, but not nearly as easy as connecting to an OAuth2 server, which is pretty much automatic.

Note that this is not a way of using OAuth2 to connect, which is what you literally asked. Rather, it is a way of using chrome.identity (for a Chrome App) to connect to an OAuth1 server.

答案2

得分: 0

Cloud Endpoints似乎正是我需要的解决方案。它们(尚未?)不是GAE for Go官方文档的一部分,但可以在Github上找到。

开始的最佳方式可能是参考示例的井字棋应用。

使用Google+登录按钮进行了快速测试(尽管由于可能错误的配置,它在幕后执行了多个调用,其中一些导致了作用域错误)。

英文:

Cloud Endpoints seem to be exactly the solution I need. They are not (yet?) a part of the official GAE for Go documentation, but can be found at Github.

Probably the best way to start is the examplary tictactoe app.

A quick test with the Google+ Sign-In button was successful (although with my probably wrong config it is performing multiple calls under the hood and some of them resulting in scoping errors).

huangapple
  • 本文由 发表于 2014年7月15日 05:00:54
  • 转载请务必保留本文链接:https://go.coder-hub.com/24745896.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定