Invalid grant for refresh token. Upstream issue?

Hi I am trying to use the refresh token to generate a new access token for the user. I have checked out this post, and I am sure I am having the correct input.
OAuth2 Refresh Token Grant

However, I keep on getting this:

{
  "error": "invalid_grant"
}

Which is not a helpful message, and it can represent multiple errors: Google OAuth “invalid_grant” nightmare — and how to fix it | by Lasse B. Andersen | Inside Timekit

So has anyone bumped into this as well? Do you have any issue with using the refresh token? How can I fix this?

@flovo Sorry for pinging you, but I am clueless right now. What may goes wrong there? What have I missed?

I am testing with this curl:

curl -X POST -d 'grant_type=refresh_token&username=kghugo&refresh_token=xxxxxx&client_id=nlnVKkcGma6UVnpSeAaFvLDYjrXdJ854blXbg3ty&client_secret=xxxxxx' https://online-go.com/oauth2/token/

I don’t see anything wrong there, but I’m currently not set up to run the command on my own machine to check the details.

1 Like

Thanks for the reply flovo. I hope you can help me out again when you are free, I am unable to locate this issue. Gave up on this feature at the moment.

I can’t check your command at the moment to see what is wrong, but here is a link to a project I wrote that uses the API, and specifically the part that handles refresh tokens https://github.com/dylanross620/Rengo-Bot/blob/main/api/rest.py#L26

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.