actions-on-google / assistant-conversation-nodejs

A developer friendly way to fulfill Actions SDK handlers for the Google Assistant
https://actions-on-google.github.io/assistant-conversation-nodejs
Apache License 2.0
104 stars 38 forks source link

How to get decoded token and user profile after account linking completed? #23

Closed denkigai closed 3 years ago

denkigai commented 3 years ago

In this section, the document says

If you use the Actions on Google Fulfillment library for Node.js, it takes care of validating and decoding the token for you, and gives you access to the profile content, as shown in the following code snippets.

and I tried to deploy the completely same code with the sample code snippet in preview mode, but I could not get any user profile but got just a string (it's like RwczovL2xoMy5nb2...) from conv.headers.authorization.

Of course I tried JSON.stringify(conv) but I could not find decoded token nor user profile from it.

How can I get user email or name from conv in webhook?

I've almost given up using Account Linking feature on Actions on Google...

denkigai commented 3 years ago

I completely followed the sample project here, but i found that clientId was not set on cloud function via .env file, and now I write it directly on the code for workaround. How it's be solved? anyway it would save your time to check the value of your clientId if the same problem hits you.