0
votes

We are planning to support voice action in our application to add user specific action. For example : If user says "Add milk" to google assistant, "milk" is going to added in application db on user account. For that, I have used Account linking(Implicit Flows) in Google Action as per this tutorial (https://developers.google.com/actions/identity/oauth2-implicit-flow).

When i test dialog follow agent, i have enable "Sign-In" required checkbox for all intent including welcome intent. So that, when i invoke my application it will ask the user to sign in to link account to google.

I got the link account message and It has successfully linked. It says "Great! Your account is now linked to Google" message.

Now, I have used webhook url to handle "add " intent. And intent is getting call our api as per the webhook. But when i print header in request, i couldn't see application Access Token, which is saved in Google. But as per the document (https://developers.google.com/actions/identity/oauth2-implicit-flow#handle_data_access_requests) it will be available in header. But i cannot see access token in api request.

Why is the Bearer access token missing in request?

1

1 Answers

2
votes

That section gives generic information about the auth token. See the paragraph that says

The specific method of attaching an access token to a request depends on the Google service that's calling your API. See the service's developer documentation for details.

The access token is available in the User object in the accessToken field. You can get the User object using the conv.user object if you're using the actions-on-google library and in the User environment attribute if you're using the multivocal library.