首页 文章

使用Firebase或Cloud Endpoints身份验证的移动应用程序与Google App Engine后端

提问于
浏览
2

我正在使用Google App Engine中的后端开发移动应用程序(Ionic) . 此应用需要使用Google身份验证和Google App Engine(Python)应用程序的安全交换进行登录 .

谷歌正在展示2种配置来实现这一目标 .

  • 移动客户端< - > Firebase < - > Google App Engine:

enter image description here

  • 移动客户端< - > Cloud endpoints < - > App Engine:

enter image description here

在我目前的方法 1 中,Ionic应用程序能够登录Google并与Firebase交换信息,Firebase能够与Google App Engine进行交互,但我不确定如何通过Google App获取Ionic应用程序进行身份验证和安全交换发动机 .

我可以使用这种方法吗?或者我是否需要使用 2 移动客户端< - > Cloud endpoints < - > App Engine

谢谢 .

2 回答

  • 0

    我也在为我的应用程序运行方法1 .

    登录后,您将在Android客户端上收到Firebase的身份验证令牌 .

    接下来,您需要将此令牌传递给您的 Cloud endpoints . 请参阅以下链接:

    Send Firebase Token from Android to Google Cloud Endpoints

    您必须在Google App Engine上验证令牌 . 请参阅:

    How do I secure my Google Cloud Endpoints APIs with Firebase token verification?

    请看

    Google Cloud Endpoints and user's authentication

    为您的Cloud Endpoints实现自己的自定义身份验证器

  • 0

    您正确使用第一种方法,因为它使您能够受益于Firebase基础架构及其在平台page上所述的附加功能 .

    现在,使用Firebase tutorial在App Engine上验证用户是根据您的第一个配置组装应用程序的一个很好的示例 . 您可能需要查看服务器section上的身份验证用户,以获取有关Ionic应用程序如何与App Engine服务器交互的更多详细信息 . 解释说,一旦您的用户通过添加的Firebase身份验证用户interface(在您的Ionic应用程序上)登录,应用程序和服务器之间的通信将通过令牌处理,如here所述 .

    第二种方法也是可行的,但您必须实现自己的身份验证机制或使用类似的应用程序框架Flask . 提供的教程中的应用程序已经基于的框架 .

相关问题