简体   繁体   English

将Google AppEngine应用程序用作OAuth提供程序

[英]Using Google AppEngine app as a OAuth provider

I'm using the Google AppEngine 1.3.4 SDK which offers to allow your application to act as a OAuth service provider ( http://code.google.com/appengine/docs/python/oauth/ ). 我正在使用Google AppEngine 1.3.4 SDK,该SDK可让您的应用程序充当OAuth服务提供商( http://code.google.com/appengine/docs/python/oauth/ )。 Setting up a standard application on my localhost and using the following: 在我的本地主机上设置标准应用程序,并使用以下命令:

Request URL /_ah/OAuthGetRequestToken
Authorize URL /_ah/OAuthAuthorizeToken
Access Token URL /_ah/OAuthGetAccessToken

The client application just gets sent to a page requesting to grant OAuth access even though no user is logged in. Clicking 'Grant access' results in a message saying 'OAuth access granted' with no tokens or anything exchange. 即使没有用户登录,客户端应用程序也只会发送到一个请求授予OAuth访问权限的页面。单击“授予访问权限”会导致显示一条消息,表明“没有授予OAuth访问权限”,没有令牌或进行任何交换。 Can't see how this could work when it's not even prompting for a login. 甚至不提示登录时,无法看到它如何工作。

As this functionality is quite new I can't find much out there. 由于此功能是相当新的功能,因此我在此找不到太多。 I've created a OAuth provider before in Rails and know that you need a Consumer Key and Secret, something that seems to be lacking in GAE? 我之前在Rails中创建了一个OAuth提供程序,并且知道您需要“使用者密钥和机密”,而GAE似乎缺少这种功能?

Any ideas on how to get OAuth working in a sample GAE project are most welcome. 我们欢迎任何关于如何在示例GAE项目中使用OAuth的想法。

I would hazard a guess that the SDK implementation simply grants access regardless. 我可能会猜测,无论如何,SDK实现只会授予访问权限。 It's also possible you still have a dev_appserver login cookie. 还有可能您仍然有一个dev_appserver登录cookie。 Either way, try it in production - it'll almost certainly request login in that case. 无论哪种方式,都可以在生产环境中尝试-在这种情况下,几乎可以肯定会要求登录。

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

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