Search code examples
actions-on-googlegoogle-smart-home

token exchange endpoint not called after authorization endpoint redirect


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.


Solution

  • 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:

    1. Open the Settings gear, change OAuth endpoints to Custom
    2. Enter your authorization and token URLs from the Actions console
    3. 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.