Google App Engine:使用ID和密码进行端点身份验证 [英] Google App Engine: Endpoints authentication with ID and password

本文介绍了Google App Engine:使用ID和密码进行端点身份验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个HTML5客户端访问Google Cloud Endpoints后端.我们希望为用户提供合理的登录方法范围,例如:登录和现有的OpenID,或者注册带有电子邮件和密码.这些对我们来说似乎是基本要求!如果有更好的替代方案不限制我们的受众群体,那么我们会考虑使用它.

We have an HTML5 client accessing a Google Cloud Endpoints backend. We want to offer users a reasonable range of sign-in methods, e.g.: sign-in with an existing OpenID, or alternatively sign-up with an email and password. These seem like basic requirements to us! If there is a better alternative that does not restrict our audience, then we'd consider it.

我们遇到了两个问题:(1)看来Endpoints服务只能验证Google帐户的身份;(2)我们不知道如何与Endpoints一起支持使用电子邮件和密码注册".

We're encountering two problems: (1) it seems the Endpoints service will only authenticate Google accounts, and (2) we don't know how to support "sign-up with email and password" together with Endpoints.

我们发现我们的要求可以与Endpoints一起使用,但是没有找到任何有助于或支持OpenID提供程序的Python示例.我们创建了自己的电子邮件/密码"身份验证选项,并将其与Google OAuth并行启用.总体而言,使用Cloud Endpoints时有关身份验证的文档很少.对于较新的"Mobile Backend"项目,文档和示例更加强大.

Edited: We found that our requirements can work together with Endpoints, but we did not find any Python examples to help, or to support an OpenID provider. We created our own "email/password" authentication option and enable it in parallel with Google OAuth. Overall the documentation on authentication when using Cloud Endpoints is minimal. Documentation and examples are stronger for the newer "Mobile Backend" project.

推荐答案

您是正确的,此时,您可以使用app-engine中提供的lib来构建oAuth提供程序,但这需要您的用户拥有Google帐户.因此,为了保护我的API,我必须构建自己的自定义oAuth2提供程序.我是通过使用python oAuthLib库( oAuthLib )来完成此操作的.他们有一个很棒的文档,将指导您完成操作.我还就如何使它成为特定于应用程序引擎做了一个粗略的文档.如果有兴趣,请查看链接博客页面

You are right, at this point you can build an oAuth provider using the lib provided in app-engine but that requires your users to have an Google account. So to protect my API I had to build my own custom oAuth2 provider. I did this by using the python oAuthLib library (oAuthLib). They have an awesome doc that will guide you through. I also made a rough document on how I made it app engine specific. If interested please take a look at the link Blog page

我希望这会有所帮助.

这篇关于Google App Engine:使用ID和密码进行端点身份验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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