[英]Google OAuth2.0 refresh access_token
I'm making a function to post to google my business automatically by using Google my business API by javascript and firebase.我正在制作 function 通过使用 Google 我的业务 API 自动发布到谷歌我的业务 javascript 和 ZBF12E15515C413AFC9DFA8 The access token is obtained by authentication using Google Sign In.
访问令牌是通过使用 Google 登录进行身份验证获得的。 However, the access token has an expiration date, so I have to renew it using a refresh token.
但是,访问令牌有一个到期日期,所以我必须使用刷新令牌来更新它。 Can I use the "user.refreshToken" shown in the image below as the refresh token to be used in this case?
我可以使用下图中显示的“user.refreshToken”作为在这种情况下使用的刷新令牌吗? Thanks in advance.
提前致谢。 Data retrieved upon sign-in
登录时检索的数据
Yes, you are right.是的你是对的。 In general, the refresh token in an OAuth2.0 flow can be used to retrieve a new access token, which can then be used again to access resources.
通常,OAuth2.0 流中的刷新令牌可用于检索新的访问令牌,然后可再次使用该令牌访问资源。 The refresh token normally has a much longer expiration date than the access token hence you can implement functionality like "remember me" using the refresh token.
刷新令牌的到期日期通常比访问令牌长得多,因此您可以使用刷新令牌实现“记住我”等功能。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.