I have created my first Google Smart Home project and implemented the two endpoints for account linking. The authorization endpoint is called and my code respond by redirecting (302) to the redirect_uri providing an authorization code, however the token exchange endpoint is never called. The account linking is triggered from the Google Assistant UI, when linking a device. It goes into "Manage Accounts". I click my [test] display name, it goes to my account linking site, then goes back to the "Manage Accounts" screen. The token exchange endpoint is not called and, of course, no SYNC happens. What I may be doing wrong? How can I debug the flow? I get no error anywhere... Thanks in advance for any hints or help.
-
If your app is failing to link the account, there should at least be an OPEN_AUTH_FAILURE or something of the sort in the error log. Have you reviewed the contents of your StackDriver logs? https://developers.google.com/assistant/smarthome/develop/error-logging – devunwired Jan 10 '20 at 04:39
-
Thanks for your reply. I have checked StackDriver logs, but I cannot find anything apart from a few information messages from when the project was created. Is there a particular resource I should be looking at? – Alex Jan 11 '20 at 12:03
-
I have done a few experiments and I noticed that this problem happens only when I add a device from my phone. I tried the same procedure from my tablet and the token endpoint is called. A bit of investigation revealed that it seems like my phone does not know how to handle the com.google.android.apps.gsa.gdi: protocol, that seems to be used as a reply to the redirect. I tried to uninstall and reinstall the assistant, but it did not solve the problem... Suggestions? – Alex Jan 11 '20 at 12:10
-
I would make sure you have the latest version of the Google Home, Google Assistant, and Google (Search) apps on your device. – devunwired Jan 13 '20 at 03:33
-
I have double checked. All the Google apps are at the latest level and recently I also got a system update that I installed. The phone I have is a Huawei P20 Pro (CLT-L09)... not sure how to fix. – Alex Jan 22 '20 at 07:03
2 Answers
You can use the Google OAuth Playground to verify that your account linking implementation is working properly. Here is how you can configure this tool to test your endpoint:
- Open the Settings gear, change OAuth endpoints to Custom
- Enter your authorization and token URLs from the Actions console
- Enter your client ID and secret from the Actions console
You won't be authorizing any Google APIs, so for Step 1 you can just enter something like "devices" and click Authorize APIs. You can follow through with the flow in Step 2 to verify that the authorization and token exchange work properly. The tool will report if any errors occur in the flow.
If you can successfully verify your account linking implementation, but you are still seeing errors linking from your device, please file an issue with the details of the device and the various Google app versions you are using.

- 62,780
- 12
- 127
- 139
I was facing the same problem. I resolved it by uninstalling my Chrome browser on the phone. It seems that the login authentication process was initiated in the browser and the browser was not able to redirect to the com.google.android.apps.gsa.gdi: protocol. After uninstalling the browser, the login authentication was done by Google Home and it was able to recognize the protocol and call token exchange.

- 1
- 1