简体   繁体   中英

Long term account linking with Google Home

At the moment I'm using OAuth and Google Sign-In for account linking in my app. After this is done an accessToken is sent along with the request to my webhook. But the accessToken is only valid for a hour. For my Application to work correctly and have a smooth user interaction I don't want my users to link their account every hour. So how do I set up a more permanent account linking process?

It depends on the details of the OAuth mechanism that you're using with Account Linking.

If you are using the Implicit Flow, then the tokens from your OAuth server are assumed to be good indefinitely.

If you are using the Auth Code Flow, then you should be returning both a short-lived access token and a refresh token that does not have an expiration. Google will use this refresh token to contact your OAuth server when the access token has expired to get a new access token , which will be sent to your webhook.

If all you need is a single, consistent, identifier that also has some validity outside of the Assistant, you can look into Google Sign In (both for apps and websites and for the Assistant). This will give you access to the user's Google ID, with their permission.

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