Actions on google account linking returns error

668 Views Asked by At

My Dialogflow agent is integrated with Google Assistant, I am trying to extend it with Actions on Google. Now we are trying Account linking with our client's Oauth server. Auth URL, Redirect URI, Client secret, and Client Id are provided by them and the same is configured in the account linking section of my project in Actions Console with authorization code flow. Using the same details, I was able to implement the account linking to my Alexa Skill. I am using Node.js as my webhook, the same is using actions-on-google package for handling intents. I got the below piece of code from the documents, the same is added to my 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());

})  

Whenever I invoke the agent, it is asking me to Link the account with Google(I'm not trying to login with Google though) the browser opens with My client's OAuth authorization endpoint, I have provided the login information and it returns back to the Google Assistant app with an error message saying

Sorry, something went wrong, so I couldn't sign you in. But you can try again later

I tried outputting the variable sign in to the console and I can see the below error

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

In the Google Assiatant App, I could see the redirect URI params as

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

I need clarity in below points

  1. Can I implement Account Linking with other Oauth Servers in Actions on Google other than Sign in with Google?
  2. Are there any other steps I am missing with the code or Dialogflow and Actions on Google Console?

Help here is really appreciated. Please let me know if the provided information is not sufficient.

1

There are 1 best solutions below

0
On

The issue was solved, I have to check the checkbox in Account linking settings which says "Google to transmit ClientId ans secret via HTTP basic auth header"