OAuth refresh rate limit? invalid_grant

#1

I’ve been having problems getting a 401: UNAUTHORIZED with body {"error": "invalid_grant"}
I suspect this is because I’ve hit some internal rate limit on token refreshing after having to do some serious work on my token refresh logic (and subsequent testing).
Can somebody confirm this is the case? (Or an alternative.)

I re-authorized my account to get a new access token & refresh token and it seems to have fixed this issue.

2 Likes
#2

There are currently no rate limits on refreshing a token. As a sanity check, are you passing the correct access, refresh token, and grant type in your request?

1 Like
#3

Considering everything started working again after I re-authorized my own account, I assume I was.
I didn’t change the code actually refreshing the token, only when it was called.

First I was testing global refreshes for all users, tested that a number of times. Then I changed over to only refreshing (parallelized) if a request came in if it was needed.
I was doing refreshes on every single request while testing, which is what I thought was caused the issue.

I now believe I may have allowed a duplicate parallelized request at one point, causing a race condition.

So, Case closed I guess :smiley:

2 Likes