简体   繁体   中英

Google Smart Device API Oauth2 Refresh Token Expires

I am building a server side app to periodically access information from users' Google devices and notify them when certain criteria are met.

I have a few test users signed up, and they have gone through the Google oauth2 login. The app has received their auth code, requested offline access, and stored their refresh tokens in a separate DB location. The app then polls their smart devices periodically using the refresh token to obtain access as needed.

My problem is that the test users' refresh tokens are expiring after a few days of use. I couldn't find any documentation from Google about refresh token longevity. Is a few days normal for a refresh token to expire?

If so, my server side app will require user intervention way too often to be useful.

https://developers.google.com/identity/protocols/oauth2#expiration

The sandbox tokens are good for a week but if your application is released officially then you can use the regular refresh tokens.

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