简体   繁体   中英

Google Action Account Linking token endpoint parameters

I'm new to google action and I tried to connect my express api with google smart home action. All was fine until I got google token request without any parameters.

In the documentations it said it will send client_id,client_secret and etc... But when I log the res.query it only show undefined. It still work when auth request is made and also work with login and redirect back to the app. I also checked token exchange endpoint url. But it still doesn't work.

Account Linking through Google Home App consists of two steps: Users are sent to your Authorization Url to provide credentials and complete the consent flow. Once this process is completed successfully, your server gets a token exchange request containing the authorization code at your Token Url. In order to debug this flow, you might need to understand if your credentials exchange completes successfully. You can learn more from the Account Linking Documentation for Google Home.

Also a heads up here, in case this is relevant to your issue. Many function calls and variable values are called/populated asynchronously in NodeJS. In case you are reading their values without waiting for them to get executed properly, you might end up with undefined values. You might want to go through your code and check if you are waiting for the values in a synchronous (blocking) manner.

If you still have issues after debugging, you can also go through our introductory codelab . It does have a fully functioning OAuth 2.0 implementation that you can take reference

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM