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 the access token for a linked account? #15

Open ryanleung96 opened 4 years ago

ryanleung96 commented 4 years ago

From the user schema, the access token field is not listed. How I retrieve the access token issued from my OAuth2 provider for the current user?

Fleker commented 4 years ago

It should appear in the Authorization request header.

ryanleung96 commented 4 years ago

It should appear in the Authorization request header.

I don't get it. What I referring to is after the account linking has completed, how my fulfilment server gets the token from Google Assistant?

The legacy Java Actions SDK has the getAccessToken method to retrieve the token from User object in fulfilment request.

shivan commented 3 years ago

I use conv.user.params.bearerToken, as this contains the token. For me this works great.