简体   繁体   English

在Google的“操作”上关联帐户,设置OAuth服务器

[英]Account linking on Actions on Google, setting up a OAuth server

before you hate on me, I tried looking for this information everywhere, and even if I found something similar, nothing really hit the mark. 在您讨厌我之前,我曾尝试在所有地方寻找这些信息,即使我发现了类似的内容,也没有真正达到目的。 So basically I am implementing this action on google app that communicates with firebase and retrieves information from firebase that is specific for every user. 因此,基本上我是在与Firebase进行通信并从Firebase检索针对每个用户的信息的Google应用上实现此操作的。 Everything I need is an identifier for the user, nothing super hard, the first thing that I thought was to retrieve the email that the user used to set up the google assistant(I don't know why, but in my mind I thought it would have been easy). 我需要的一切只是用户的标识符,没有什么难的,我想的第一件事就是检索用户用来设置Google助手的电子邮件(我不知道为什么,但是在我看来,我认为是会很容易)。 Apparently to do this I would have to dive in the magical world of account linking, which I really wouldn't like to do. 显然,要做到这一点,我将不得不进入一个神奇的帐户关联世界,而我确实不愿意这样做。 The question is, is there a way to retrieve any kind of unique information about a user without using account linking? 问题是,有没有办法在不使用帐户链接的情况下检索有关用户的任何种类的唯一信息? And if the answer is no, and I have to set up a OAuth endpoint, is there someone that would help me out? 如果答案是否定的,而我必须设置一个OAuth端点,是否有人可以帮助我? I have no experience in web dev and I tried doing it by myself but I am just completely lost. 我没有网络开发人员的经验,我尝试自己做,但是我完全迷路了。 Thank you in advance. 先感谢您。

We don't hate you - but you may hate the answer. 我们不讨厌您-但您可能讨厌答案。

The only unique identifier that Actions on Google provides you is the anonymous userid. Google上的操作为您提供的唯一唯一标识符是匿名用户ID。 You can get this with app.getUser().userId if you're using the node.js library, or it is available in the JSON. 如果您使用的是node.js库,则可以使用app.getUser().userId来获取它,或者可以在JSON中使用它。

This identifier, however, is unique to just your Action and does not provide any other information, such as email address, for privacy purposes. 但是,此标识符仅对您的操作是唯一的,并且不会出于隐私目的提供任何其他信息,例如电子邮件地址。 If you just want to make sure that the user that is visiting you today is the same user as the one that visited you yesterday - this userid should be enough. 如果您只想确保今天访问您的用户与昨天访问您的用户相同,则该用户ID应该足够。

If you need an identifier that is available outside of Actions (for example, if you also have a website or a mobile app that users log into), then you will need to use Account Linking, and will currently need to setup an OAuth server. 如果您需要在Actions之外可用的标识符(例如,如果您还有用户登录的网站或移动应用程序),则将需要使用“帐户链接”,并且当前将需要设置OAuth服务器。

Setting up an OAuth server is not a straightforward task, and while there are packages and services that are available, exactly which one you should use is not something that can be addressed on StackOverflow. 设置OAuth服务器不是一件容易的事,尽管有可用的软件包和服务,但是您应该使用哪个软件包和服务恰恰不能在StackOverflow上解决。 Google does provide a guide about the minimum necessary for a valid OAuth server to work with the Assistant, and it is hoped that they'll provide a better solution in the future. Google确实提供了有关有效OAuth服务器与Assistant配合使用的最低要求指南 ,并希望它们将来会提供更好的解决方案。

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

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