[英]How to Account Link existing Firebase Auth with Google Actions
I have a mobile app that has data & auth on Firebase.我有一个移动应用程序,它在 Firebase 上有数据和身份验证。 I want to create a Google Action for these same users.
我想为这些相同的用户创建一个 Google Action。
This post asked basically the same question and the top reply says "However, you can use Firebase Auth if you're willing to setup your own OAuth2 server. If you set one up you can have them login using Firebase Sign-In, generate the token and store it against their Firebase ID, and issue that token to the Assistant client. When you get that token back, you can easily associate it back to the Firebase ID." 这篇文章问了基本相同的问题,顶部回复说“但是,如果您愿意设置自己的 OAuth2 服务器,您可以使用 Firebase 身份验证。如果您设置了一个,您可以让他们使用 Firebase 登录,生成“
Does anybody have an example or a more in depth guideline of how to accomplish this?有没有人有一个例子或更深入的指南来说明如何做到这一点?
That post you linked is quite old and AoG is changing fairly rapidly.您链接的那篇文章已经很老了,而且 AoG 的变化很快。 Case-in-point, they released their new "conversational actions" just last month (2020-06), and with these it is quite easy to use Google accounts and firebase auth.
举个例子,他们就在上个月(2020-06)发布了新的“对话操作”,有了这些,使用 Google 帐户和 firebase auth 非常容易。
The docs for thisare here BUT don't use the code provided in the docs - I found it to be quite broken as of 2020-07 - use the sample actions on their github instead.文档在这里但不要使用文档中提供的代码 - 我发现它在 2020 年 7 月已经完全损坏 - 请改用 github 上的示例操作。
This gives the user an easy way to connect their google account to your action with just their voice resulting in a Firebase authentication.这为用户提供了一种简单的方法,只需他们的声音即可将他们的谷歌帐户连接到您的操作,从而获得 Firebase 身份验证。
Now the part I'm not sure about is, if your action and your app use use the same GCP/Firebase project and the same client ID, will they produce the same 'user uid' in firebase auth.现在我不确定的部分是,如果您的操作和您的应用使用相同的 GCP/Firebase 项目和相同的客户端 ID,它们是否会在 firebase 身份验证中生成相同的“用户 uid”。 Probably not, but if so you would be done and the whole thing would be very easy.
可能不会,但如果是这样,你就会完成,整个事情会很容易。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.