Search code examples
oauth-2.0accountdialogflow-esactions-on-google

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 ^^


Solution

  • 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.