Closed aniespica closed 6 months ago
We are seeing the exact same issue as described above. Still looking for solutions.
We are also having this exact issue. Are there any updates on this? I have a hunch ours is related to this issue.
Edit: It looks like our issue was with the functional expiration time of refresh_tokens. This issue is what helped us solve our problem. The refresh_token has a stated expiration of 100 days, however it gets regenerated every 24-26 hours?? The API doesn't honor old refresh_tokens if a new one has been reissued. So effectively they "expire" every 24-26 hours. Still a bit confused with this but it solved our problem.
@jackammon @aniespica have either of you experienced a user not being able to connect at all? For some reason, when trying to generate a token we keep getting a Token invalid
when literally we're generating a new token haha. Super frustrating but I expect nothing more from QBO's API service. Below is our code to generate a new token in the callback function.
const oauthClient = createOauthClient();
try {
await oauthClient.createToken(req.url);
} catch (e) {
req.log.error(e, 'qb-error');
res.sendStatus(401);
return;
}
Any update here?
Thanks @JoeMartin2001 , @thekennysong , @jackammon , @codescalar , @aniespica -- appreciate all your patience and support. Please check out the latest npm package released:
https://www.npmjs.com/package/intuit-oauth/v/4.1.1
Closing this issue for now. Feel free to re-open if you see any issues. Thanks
For some of our clients twice a week the refresh token ends with invalid_grant. We contact them and request to re-authenticate to get new access & refresh token. It is annoying that it happened and we don't know how to handle it in the code.
Currently, our flow is:
But for a few of our clients the
refreshUsingToken()
method response withinvalid_grant
. The following is a response for one of our clients with this issue:What can we do to handle this issue by code?