我正在为与 API.AI 的“Actions on Google”集成开发帐户链接集成,以便与 Google Home 一起使用。当我在模拟器中测试这个代理时(https://developers.google.com/actions/tools/web-simulator)
正如所料,这是我的回应:
{
"response": "It looks like your conference manager account is not linked yet. You can link conference manager to your Google Account from the Google Home app.",
"audioResponse": "//NExAARC..."content_copy,
"debugInfo": {
"sharedDebugInfo": [
{
"name": "Account Linking Url",
"debugInfo": "https://assistant.google.com/services/auth/handoffs/auth/start?provider={project-id}_dev&return_url=https://www.google.com/"
}
]
}
}
但是,当我遵循
res.debugInfo.sharedDebugInfo[0].debugInfo
链接,我得到标准的redirect_uri_mismatch错误页面,详细信息:
请求中的重定向 URI https://oauth-redirect.googleusercontent.com/r/my-project-id与授权给OAuth客户端的重定向 URI 不匹配。访问 https://console.developers.google.com/apis/credentials/oauthclient/my-client-id ?project= my- client -id 以更新授权的重定向 URI。
当然不可能将googleusercontent域添加到重定向中,这不是我在 API.AI Actions on Google 集成中指定的重定向。
在 API.AI 方面,我的 Auth Url 是标准的 Google 网址:
https://accounts.google.com/o/oauth2/v2/auth
我的令牌 URL 是:
https://myendpoint.com/google-home-token-endpoint
范围填写为calendar
在谷歌开发者控制台上,我将令牌 URL 设置为与 API.AI 中的相同,项目 ID/客户端 ID 与请求中的引用相同。
这是一个已知的问题?我可以尝试其他调试工作吗?