【问题标题】:Actions on google account linking returns error谷歌帐户链接操作返回错误
【发布时间】:2020-12-29 19:35:52
【问题描述】:

我的 Dialogflow 代理已与 Google Assistant 集成,我正在尝试使用 Actions on Google 对其进行扩展。现在我们正在尝试将 Account 链接到我们客户的 Oauth 服务器。 Auth URL、Redirect URI、Client secret 和 Client Id 由他们提供,并且在 Actions Console 中我的项目的帐户链接部分中配置了相同的配置,授权代码流 .使用相同的细节,我能够实现与我的 Alexa Skill 关联的帐户。我使用 Node.js 作为我的 webhook,同样使用 actions-on-google 包来处理意图。我从文档中获得了以下代码,将其添加到我的 webhook 中

const app = dialogflow({ debug: false })

app.intent('Get Signin', (conv, params, signin) => {
    console.log("signin", signin)
    if (signin.status === 'OK') {
        const access = conv.user.access.token // possibly do something with access token
        conv.ask('Great, thanks for signing in! What do you want to do next?')
    } else {
        conv.ask(`I won't be able to save your data, but what do you want to do next?`)
    }
})

app.intent('Default Welcome Intent', (conv) => {
    conv.ask(new SignIn());

})  

每当我调用代理时,它都会要求我将帐户与 Google 关联(尽管我没有尝试使用 Google 登录)浏览器打开时使用我的客户端的 OAuth 授权端点,我提供了登录信息并返回返回 Google Assistant 应用并显示错误消息

抱歉,出了点问题,所以我无法让你登录。但你可以 稍后再试

我尝试将变量登录输出到控制台,我可以看到以下错误

{
  '@type': 'type.googleapis.com/google.actions.v2.SignInValue',
  status: 'ERROR'
}

在 Google Assiatant 应用中,我可以看到重定向 URI 参数为

https://oauth-redirect.googleusercontent.com/r/YOUR_PROJECT_ID?code=AUTHORIZATION_CODE&state=STATE_STRING

我需要澄清以下几点

  1. 除了 Sign in with Google 之外,我能否在 Actions on Google 中实现与其他 Oauth 服务器的帐户链接?
  2. 代码或 Dialogflow 和 Actions on Google 是否缺少其他步骤 控制台?

非常感谢您的帮助。如果提供的信息不充分,请告诉我。

【问题讨论】:

  • 您是否在 Dialogflow 中创建了“获取登录”意图并将 google 登录事件中的操作添加到其中?
  • @Jordi 是的 Google 助理登录事件也设置为它
  • 您的代码看起来不错,所以我的猜测是 Google 和您客户的 Oauth 服务之间有问题。您能否再次检查您的配置是否使用了客户提供的正确值?
  • @Jordi 更新了问题..你可以看到我已经更新了身份验证后重定向 URI 的样子

标签: node.js oauth dialogflow-es actions-on-google account-linking


【解决方案1】:

问题已解决,我必须选中帐户链接设置中显示“Google 将通过 HTTP 基本身份验证标头传输 ClientId ans secret”的复选框

【讨论】:

    猜你喜欢
    • 2018-03-14
    • 1970-01-01
    • 1970-01-01
    • 2011-11-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多