Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

invalid grant : Refresh token invalid

Every day I get results for several users via the api-calls. Suddenly for a lot of users that doesn't work anymore and I get a "Refresh token invalid"- error for every call.

I cannot login for those users, I only have the accesstoken of the first login (and authorization for my application). My code hasn't changed and it still work for several other users.

Can someone tell what can be happening, maybe those users are inactivated?

 

 

Best Answer
0 Votes
1 REPLY 1

Hi @BasHofstee,

 

Welcome to the forums!

 

Could you please PM me your Client ID as well as a few example user IDs that you're seeing this error from?

 

If the users were deleted, you should have received a user deleted notification that looks like this:

{
  "collectionType": "deleteUser",
  "date": "2018-04-20",
  "ownerId": "184X36",
  "ownerType": "user",
  "subscriptionId": "123"
}

If the webhook notification for this failed to send, you would have also been notified via email. You can see an example in our documentation here: https://dev.fitbit.com/build/reference/web-api/subscriptions/#notifications-of-deleted-users

 

Lastly, if a user revokes access to your application, you'll also receive a revokedUserAccess notification similar to the deleteUser notification:

[
  {
    "collectionType":"userRevokedAccess",
    "date":"2020-06-02",
    "ownerId":"225BC5",
    "ownerType":"user",
    "subscriptionId":"1234"
  }
]

Documentation can be found here: https://dev.fitbit.com/build/reference/web-api/subscriptions/#notifications-of-users-revoking-consen...

 

Can you clarify if you received either of these notifications for your users? If you have, it is up to your application to clear your database of their tokens to avoid making any further API calls to their accounts.

 

As last resort, we can temporarily enable the Oauth2 Token Recovery endpoint on your application as long as the criteria mentioned in this documentation are met: https://dev.fitbit.com/build/reference/web-api/oauth2-additions/

 

Let me know if you have any questions.

Best Answer
0 Votes