9

I am attempting to connect a Google Assistant app using DialogFlow(Api.AI) with Firebase Auth. My App uses Firebase Auth to maintain user accounts and the realtime database to store data. I would like to be able to make changes to a user's data through the Google Assistant, maybe using something like a cloud function. In order to make any user changes through Google Assistant, I need to link the user's Google Assistant account with their Firebase Auth account. The current mechanism appears to be using an OAuth flow documented here.

The question I have is, what is the best way to accomplish this? Do I need to set up a custom OAuth server? There is a lot of documentation on Google's cloud website about OAuth, but it all appears to be related to using OAuth to access Google's APIs, and I can't really see a simple way to host this linking mechanism in GCP.

There is this question that is pretty close, but the difference I have is that I don't have an external API, I just want to authenticate my user and be able to modify their data in the realtime database.

Thank you for your help!

Zomb
  • 911
  • 1
  • 7
  • 12
  • Does this answer here address your question? https://stackoverflow.com/questions/42916987/actions-on-google-account-linking-with-firebase/43016712#43016712 – Wayne Piekarski Oct 24 '17 at 01:56

1 Answers1

0

here is an example: https://github.com/malikasinger1/Quiz-Assistant i have done it myself with following best practices, feel free to comment if you don't understand something.

Inzamam Malik
  • 3,238
  • 3
  • 29
  • 61
  • Sure, can you explain what your setup is? My Angular isn't too hot: have you built a custom OAuth server as your web component and are taking responsibility for associating that with a pre-existing Firebase auth user? So architecturally: Assistant -(authenticates oauth)> Quiz -(associates FB user)> Firebase? – Estel Oct 15 '17 at 00:18
  • 1
    Thank you for the video. Looking at the code, like the commentator above, I am assuming you have set up a custom OAuth server. Could you describe that portion of your solution a little more? Thanks! – Zomb Oct 16 '17 at 16:27
  • 1
    no custom auth, it all firebase auth made a webpage hosted on firebase, on that page(as you can see) `loginWithEmail.then(getid token and redirect)`, with redirect assistant account linking will complete on every query assistant will keep that id token, on server/webhook (which is firebase function) just verify that id token with firebase admin, the verification method will give you user uid name email and etc and here you go – Inzamam Malik Oct 17 '17 at 08:25