简体   繁体   English

成功验证代码和访问令牌后,Google Actions 的帐户链接失败

[英]Account linking is failing for Google Actions after successful auth code and access token

I have Google Assistant App with Account Linking enabled.我有启用帐户关联的 Google 助理应用程序。 I am getting error while linking account to the App using "Authorization code" flow.使用“授权代码”流程将帐户链接到应用程序时出现错误。

I tested the Authorization code account linking flow via the oauthplayground ( https://developers.google.com/oauthplayground ).我通过 oauthplayground ( https://developers.google.com/oauthplayground ) 测试了授权代码帐户链接流程。 I am getting the Auth code and later used that to generate the access_token and refresh_token properly.我正在获取 Auth 代码,后来使用它来正确生成 access_token 和 refresh_token。

However, when i do the actual account linking using the assistant auth handoff url ( https://assistant.google.com/services/auth/handoffs/auth/start?account_name= {accountname}&provider={projectid}&scopes=openid+email+profile&return_url= https://www.google.com ), i am getting linking error.但是,当我使用助理身份验证切换 url ( https://assistant.google.com/services/auth/handoffs/auth/start?account_name= {accountname}&provider={projectid}&scopes=openid+ email+profile&return_url= https://www.google.com ),我收到链接错误。

User Flow:用户流程:
After the OAuth flow is initiated, user goes through login and then provides their consent. OAuth 流程启动后,用户通过登录,然后表示同意。 After the consent step is done, user is redirected back to the original redirect_uri with auth code and state value.同意步骤完成后,用户将被重定向回原始的 redirect_uri,并带有授权码和状态值。

Ex: https://oauth-redirect.googleusercontent.com/r/ {projectid}?code={auth code}&state={state value}例如: https : //oauth-redirect.googleusercontent.com/r/ {projectid}?code={auth code}&state={state value}

This page redirects the user to oauth completion page and passes both the state and code values properly.此页面将用户重定向到 oauth 完成页面并正确传递状态和代码值。
Ex: https://assistant.google.com/services/auth/handoffs/auth/complete?state= {state value}&code={auth code}例如: https : //assistant.google.com/services/auth/handoffs/auth/complete? state = {state value}&code={auth code}

User is redirected to the below URL at the end of the auth flow : https://www.google.com/?result_code=FAILURE&result_message=Account+linking+failed用户在身份验证流程结束时被重定向到以下 URL: https : //www.google.com/? result_code = FAILURE & result_message = Account+linking+ failed

My Auth service provider is returning a valid code and state properly.我的身份验证服务提供商正在正确返回有效的代码和状态。 My Token service is returning valid token information in exchange for the auth code.我的令牌服务正在返回有效的令牌信息以换取身份验证代码。 Here is the response:这是回应:

{
  "access_token": "<access token>", 
  "token_type": "Bearer", 
  "expires_in": 120, 
  "refresh_token": "<refresh token>"
}

Any help is greatly appreciated.任何帮助是极大的赞赏。

I think, it was a caching issue.我认为,这是一个缓存问题。 It's working properly now.它现在工作正常。

At the end of the flow, user is getting redirected to google.com with success result code.在流程结束时,用户将使用成功结果代码重定向到 google.com。

ie: https://www.google.com/?result_code=SUCCESS&result_message=Accounts+now+linked即: https : //www.google.com/?result_code=SUCCESS&result_message=Accounts+now+linked

I had all the steps in place since last 2 days and i have not updated anything in terms of code or configuration.自过去 2 天以来,我已经完成了所有步骤,并且我没有在代码或配置方面更新任何内容。 It was not working earlier.它没有更早地工作。 But, now it's working properly.但是,现在它工作正常。

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

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