Discussions

Ask a Question
Back to All

Refresh Token Issues

I use OAUTH to get an access_token with an authorization_code, and then I save the refresh token it returned for my next authorization attempt.

On my next API connection attempt, I use the previous refresh token and get a new access token- saving the new refresh token for my next attempt. This continues without issue on a cronjob- for about a day.

Then I start getting this error: "The provided authorization grant is invalid, expired, revoked, does not match the redirection URI used in the authorization request, or was issued to another client"

I then have to manually grant a new access token with a new authorization_code.

I would like to keep this automated. What am I doing wrong?

This is the first system I have run into this issue with. I am able to leave other OAUTH API systems automated for months, even years without issue or having to manually refresh any codes or tokens.