0

I am using the Quickbooks API for my application and I have used

https://intuit.github.io/QuickBooks-V3-PHP-SDK/authorization.html

generate-oauth-2-0-tokens for token generation.

The token is created successfully and I am able to use the token for updating Quickbooks. The problem is that after 1 day I receive the following error:

Refresh OAuth 2 Access token with Refresh Token failed. Body:

[{"error":"invalid_grant"}]

.

2
  • have you found any solution for this? even i am facing the same error message
    – Ash-b
    Commented Aug 7, 2018 at 7:38
  • Yes. On the next day when i request for the resource, it used to send a resource as well as new refresh token. I had to check if in the request is there any refresh token send. If yes then store in DB. This way it would become life time.
    – Avesh Naik
    Commented Aug 7, 2018 at 9:46

1 Answer 1

0

Only exchange access tokens one at a time. If two attempts are made to exchange for access tokens, the first attempt will succeed but the second will return invalid_grant.

The servers may see this as a possible security issue and revoke your refresh tokens for the first successful call. Your next attempt to refresh tokens will return the invalid_grant error. At this point, you’ll need to start the authorization process from the beginning.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.