OAuth2 刷新令牌 - 如何更新?

OAuth2 refresh token - how to update?

我正在编写一个程序,用我的 QuickBooks 帐户(使用 Node js)自动执行一些操作。但是刷新令牌也过期,我该怎么办?我收到此错误消息。

Error: The provided authorization grant (e.g., authorization code, resource owner credentials) or refresh token is invalid, expired, revoked, does not match the redirection URI used in the authorization request, or was issued to another client.

可以参考官方的node-oauth2.0 lib。 https://www.npmjs.com/package/intuit-oauth#refresh-access_token

您需要使用最新的refreshToken生成新的accessToken。

参考文档 - https://developer.intuit.com/app/developer/qbo/docs/develop/authentication-and-authorization/oauth-2.0