Successfully implemented OAuth flow within Google Actions context via account linking. However, after token expiration, it asks for user to link the account. Is there a configuration in Google Actions for token auto-refresh in this context so that the user is not re-prompted to link account after doing so already?
-
Can you clarify your question a bit? What OAuth flow did you implement and how did you implement it? (Implicit vs Auth Code?) Can you show some code to show what you're doing or show some logs to indicate what you are receiving and sending at different stages? There are a lot of possible causes, and seeing how you're doing your OAuth server will help narrow down the possible problems. – Prisoner Nov 10 '17 at 00:47
-
Thank you, @Prisoner. It's this app just launched: https://assistant.google.com/services/a/id/6b5b883eda0cdbc9/?source=web. I configured account linking on Actions on Google console using an Authorization code Grant type. I actually followed your helpful directions from https://stackoverflow.com/a/44296039/1204142. I suspect what is happening is that I still have the test version of my app still active. I just disabled the test version by clicking the icon to do so at the top of the simulator panel. I will clarify the question if I see that this resolves the problem. – Damon Nov 13 '17 at 00:05
-
I don't think it resolves the problem. See my answer. – Prisoner Nov 13 '17 at 00:36
2 Answers
Your server can send an error code that will tell Google's OAuth server to send a request for a new access token using their refresh token.

- 11,536
- 1
- 21
- 35
There are multiple problems with the app, to the point I'm a little surprised it got approved.
The first is that if you're using https://stackoverflow.com/a/44296039/1204142, then you should look at the update which indicates that Google is no longer allowing their endpoints to be used for account linking. This may explain why the card doesn't go away. Since it didn't prompt me for scopes after I authenticated myself... I'm not actually sure what it thinks it's doing.
But some code must have been sent, since the Assistant thinks we're linked. Even if the card doesn't go away.
However, when I connect, it prompts me with
OK, would you like anything else?
for the initial prompt. Which doesn't make sense in this context. But if I say "yes" it says
Sorry, I don't understand what you're asking. Say "help" to know how I can assist you.
If I ask for help, it says
Here's how piggy piggy can help.
and then leaves the mic open without saying anything further.

- 49,922
- 7
- 53
- 105
-
I had read your post one day prior to its update by implementing using https://accounts.google.com/o/oauth2/v2/auth and https://www.googleapis.com/oauth2/v4/token as Authorization and Token URLs, respectively. After the Oct 2017 update, we should be using our own endpoints? And yes, it now occurs to me that testing my own app in a vacuum leads to conversation prompts that make sense only to me. – Damon Nov 13 '17 at 06:19