简体   繁体   English

谷歌智能设备 API Oauth2 刷新令牌过期

[英]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.我正在构建一个服务器端应用程序,以定期访问来自用户的 Google 设备的信息,并在满足某些条件时通知他们。

I have a few test users signed up, and they have gone through the Google oauth2 login.我有几个测试用户注册了,他们已经通过谷歌 oauth2 登录。 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.我在 Google 上找不到任何关于刷新令牌寿命的文档。 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 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.沙盒令牌可以使用一周,但如果您的应用程序正式发布,那么您可以使用常规刷新令牌。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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