Search code examples
node.jsamazon-web-servicesoauth-2.0quickbooks

OAuth2 refresh token - how to update?


I'm writing a program that automates some actions with my QuickBooks account (using Node js).But expires refresh token also, what can i did?I have this error message.

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.

Solution

  • You can refer the official node-oauth2.0 lib. https://www.npmjs.com/package/intuit-oauth#refresh-access_token

    You need to generate new accessToken using the latest refreshToken.

    Ref docs - https://developer.intuit.com/app/developer/qbo/docs/develop/authentication-and-authorization/oauth-2.0