简体   繁体   English

关联 Google 助理的帐户

[英]Account linking Google Assistant

I actually looking for an answer for my problem of account linking on Google Assistant.我实际上是在为我在 Google 助理上的帐户关联问题寻找答案。

Sorry, the screens are in french but I can translate all if it's necessary to understand.对不起,屏幕是法语,但如果需要理解,我可以翻译所有内容。

I followed the google account linking documentation until "implement your Oauth server"我遵循谷歌帐户链接文档,直到“实现您的 Oauth 服务器”

https://developers.google.com/assistant/identity/oauth2?oauth=implicit https://developers.google.com/assistant/identity/oauth2?oauth=implicit

First:第一的:

On google Action, this is my configuration of account linking:在 google Action 上,这是我的帐户链接配置:

在此处输入图片说明

Next I'm trying to auth me on my application :接下来,我尝试在我的应用程序上对我进行身份验证:

在此处输入图片说明

I have to sign in on Google Home APP.我必须登录 Google Home APP。

I said, "talk to my test app:"我说,“与我的测试应用交谈:”

And google redirect me on my API with the authorization page.谷歌使用授权页面将我重定向到我的 API。

在此处输入图片说明

I provide my password and my email.我提供我的密码和我的电子邮件。

The auth works on my API, but unfortunately an error is display on google assistant after the redirection ...身份验证适用于我的 API,但不幸的是,重定向后谷歌助手显示错误......

在此处输入图片说明

The error message in English is : "Sorry, an error occured. I didn't succeed to sign-up. You can try again later."英文错误提示是:“对不起,出现错误,我没有注册成功,您可以稍后再试。”

I don't understand why I got this Error ...我不明白为什么我得到这个错误......

The URL GET authorize is : URL GET 授权是:

http://f8f73376.ngrok.io/api/auth/authorize?redirect_uri=https%3A%2F%2Foauth-redirect.googleusercontent.com%2Fr%2Farlex-ccevqe&client_id=*clientid*&response_type=code&state=AB8b_TOd3At3ADLyuTi9k02War1fEmzT8vBeXxgHidVA5zTHVmVmE536Sjw60EAK_rUfb4Ie84Ly2l6E5AfW-F_Eo3hipueQzGbnEfpGlUHdhIeTQyfJYCk2I5-yT_n6vceOYeVlYfXF-frpVoiSCH9K2ns-7rbbgq3wEX2Px0DX3QH5ijgSsT7lvr0vOHECCCzTav9ldYf4G-EcruSModayIhIYBMKjKUQJqddBjJZ5JyCEE0cOJNvOeI13T35WoJ8_0HYoX2BXRYKGUJLiEOHX_cNlLWmcL1Y5wzDze6wa-qTM7Hvg7cutqO_u9pnhNWeMDkMgQljpSfUzyP7Ry1iWziE64nMtDmhxA48Qbufm-bRjpTRTCOBQN-_gLmx1aT2bBGTouSyg6cNY8E33HCzsp7H8qRfKYTdZ_Ga0IJcOam9MjNp2XFfgrw0uV7TTLig2LmYyJG_d-6urRGBY-xcwRxWkp7vCUtWvY6CXEZsF42rTjXYk-kr8xraS-2tNvgavhLASGvVVVgIg0AVSNZLdw9qvQMM-4NRFwsrAkZWz08kO493_lvA&user_locale=fr-FR

And the URL I sent for the redirection is:我为重定向发送的 URL 是:

https://oauth-redirect.googleusercontent.com/r/arlex-ccevqe#access_token=65cc814038a84114b8922b47eebc45cb&token_type=bearer&state=AB8b_TOd3At3ADLyuTi9k02War1fEmzT8vBeXxgHidVA5zTHVmVmE536Sjw60EAK_rUfb4Ie84Ly2l6E5AfW-F_Eo3hipueQzGbnEfpGlUHdhIeTQyfJYCk2I5-yT_n6vceOYeVlYfXF-frpVoiSCH9K2ns-7rbbgq3wEX2Px0DX3QH5ijgSsT7lvr0vOHECCCzTav9ldYf4G-EcruSModayIhIYBMKjKUQJqddBjJZ5JyCEE0cOJNvOeI13T35WoJ8_0HYoX2BXRYKGUJLiEOHX_cNlLWmcL1Y5wzDze6wa-qTM7Hvg7cutqO_u9pnhNWeMDkMgQljpSfUzyP7Ry1iWziE64nMtDmhxA48Qbufm-bRjpTRTCOBQN-_gLmx1aT2bBGTouSyg6cNY8E33HCzsp7H8qRfKYTdZ_Ga0IJcOam9MjNp2XFfgrw0uV7TTLig2LmYyJG_d-6urRGBY-xcwRxWkp7vCUtWvY6CXEZsF42rTjXYk-kr8xraS-2tNvgavhLASGvVVVgIg0AVSNZLdw9qvQMM-4NRFwsrAkZWz08kO493_lvA

There are two possible OAuth2 flows that you can use: Implicit (or "token") and Authorization Code (or "code").您可以使用两种可能的 OAuth2 流程:隐式(或“令牌”)和授权代码(或“代码”)。 While they are similar, there are some significant differences between the two in values of some of the parameters, how those parameters are sent back, and what else you need to support for each flow.虽然它们很相似,但两者在某些参数的值、这些参数的发送方式以及每个流需要支持的其他内容方面存在一些显着差异。

Although the URL you provided indicated you were following the "Implicit" flow, your screen shot shows you set Actions on Google to expect the Authorization Code flow.尽管您提供的 URL 表明您遵循的是“隐式”流程,但您的屏幕截图显示您将 Actions on Google 设置为期待授权代码流程。 Additionally, Google is sending you a URL with response_type=code , and you are responding using a redirect that includes a hash and an access_token parameter, which are expected with the Implicit flow.此外,Google 会向您发送一个带有response_type=code的 URL,而您正在使用包含哈希和access_token参数的重定向进行响应,这是隐式流所期望的。

It looks like you have most things already setup to use the Implicit Flow, so the easiest solution would be to change this configuration in the Actions on Google Console.看起来您已经设置了使用隐式流的大部分内容,因此最简单的解决方案是在 Google 控制台上的操作中更改此配置。 If you need the features that the Authorization Code Flow provide (most notably, limited lifetime for tokens), then you should adjust your server accordingly.如果您需要授权代码流提供的功能(最值得注意的是,令牌的有限生命周期),那么您应该相应地调整您的服务器。

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

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