-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OAuth invalid grant errors #359
Comments
Hi there,
|
@hannah-subtle where you able to get this solved? |
@dpreussler working on this today, will keep you posted! |
My refresh code has been in place for ages now, but 3-4 days ago it started failing repeatedly. Sometimes it works, sometimes it doesn't. It seems sporadic. Could it be related to #361? |
@jasongrishkoff what is the error you're getting when trying to refresh. |
Here's an example response. Hope it helps? {"statusCode":400,"content":"{"error":"invalid_grant"}","headers":{"connection":"close","content-encoding":"gzip","content-length":"51","content-type":"application/json; charset=utf-8","date":"Tue, 04 Feb 2025 09:09:13 GMT","referrer-policy":"no-referrer","server":"am/2","strict-transport-security":"max-age=63072000","vary":"Origin","via":"1.1 134f499632d1e15750219cb766bdc50c.cloudfront.net (CloudFront)","x-amz-cf-id":"IDOuI1W5yxZzpKJzDq1kP_RzWa5MVOTQHHdhpBEeOwLkTzCxkAADRQ==","x-amz-cf-pop":"JFK50-P3","x-cache":"Error from cloudfront","x-content-type-options":"nosniff","x-frame-options":"DENY","x-robots-tag":"noindex"},"ok":false,"data":{"error":"invalid_grant"}} I think most are refreshing just fine -- I'd guess the fail rate is 5%? I haven't actually tracked it. But I'm refreshing user tokens regularly (once per hour), so over the course of a day that means I'm needing to ask quite a few people to reconnect their accounts, as the connection failed. |
Following up in this thread as requested. |
Update: I'm seeing a huge uptick in errors today. All fairly similar: An example of the code I'm using:
This has been working smoothly for many months now. The errors started ~2 weeks ago, slowed down last week, and have picked up significantly in the last 24 hours. Hope that helps provide something to go on. Let me know if I can be of further help! |
Interesting thought! From my side, I'm actually auto-refreshing tokens every ~1 hour. They still seem to be consistently failing, though I did just have an ~18 hour patch with very few disconnects. |
I am also refreshing every hour and i am still getting the same error: Failed to refresh access token: { error: 'invalid_grant' } |
This is still a huge problem for me, as well. I've put in all sorts of code to make sure I'm avoiding race conditions and NOT requesting a refresh with the same token. Sometimes it'll go 3-4 days just fine, but today I had all 300 of my users disconnect within 1 hour. I don't know if there was a recent change with SoundCloud around this... the issue only started coming up early February. |
Massive issue for us still, I can't get it working for longer than an hour now, constant invalid grant errors |
I am currently receiving errors when trying to refresh my token
Could you help me to understand what is wrong in my authorisation flow.
Access Token Management:
Tokens are stored in a tokens.json file. access_token expiry is calculated using:
tokens.expires_at = Date.now() + tokens.expires_in * 1000
The refresh_token is used to renew the access_token when it expires.
The text was updated successfully, but these errors were encountered: