Quentin Dunand
Quentin Dunand

Reputation: 263

Google account linking existing example

I implemented a simple API.ai bot and I wanted to add it to google home platform but I really need help for the linking account part.

I don't understand if I need to implement an oauth2 protocol for my service or not. Is there any exemple or framework that allow implement this linking account step (any language is ok, it's just for a simple POC).

My goal is to ask my bot some informations and send him some orders to achieve simple processing on a server.

Hope that someone can help me, add a simple bot to google home to access and modify some informations in a server isn't really easy for me ^^

Upvotes: 1

Views: 1324

Answers (2)

Prisoner
Prisoner

Reputation: 50731

As @Leon noted, you will need to implement the OAuth2 server yourself. The Actions on Google documentation give details about what they are expecting and what steps you can do to implement it yourself. The Authorization Code flow is slightly preferred (additional features from the Assistant will require it in the future), but you're also allowed to use the https://developers.google.com/actions/identity/oauth2-implicit-flow if you wish since it is slightly easier.

There are several packages that are out there that allow you to provide OAuth2, but require you to build the connection to your own account database. I've seen packages for .NET and JavaScript, but it shouldn't be too difficult to find one that meets your needs or to write one yourself.

Upvotes: 1

Leon Nicholls
Leon Nicholls

Reputation: 4656

If you need to authenticate the user, then you will need your own OAuth server. How to hook that up to an action is described in the docs: https://developers.google.com/actions/develop/identity/account-linking

If however, this is just a personal project and you want to test it on your own device, then account linking is not necessary for you to get the action to work. You simply need to hook up your server logic to the action fulfillment. We recommend that you use the API.AI Actions integration. The docs cover how to do that: https://developers.google.com/actions/develop/apiai/dialogs-and-fulfillment

Upvotes: 1

Related Questions