Invalid grant error (solved)

Hi, I’m posting this just to let people know and avoid wasting half a day like I did. While testing OAuth access I was receiving invalid_grant errors for seemingly perfectly fine auth exchanges. After a lot of fiddling around I discovered that you can’t access your own creator’s account OAuth token: if you are testing your integrations you need to create a new account, different from the account you’re using and for which you set up your app. Social login will work but using your token will result in a generic invalid_grant error.

Nevermind, spoke too soon. I’m on Laravel/Socialite and the issue seems to be specifically related to my current framework, will update later for public consumption.

1 Like

I’ll leave this here for anyone using a framework to do OAuth. What was happening to me is that I had overlooked the fact that the code Patreon sends to the callback page is a one-off code so if I tried to use it again to get more data about the user right after Socialite had used it to log the user in I would get an error (I needed to save and use the access token). Obviously this is a mistake on my part but I feel like “code_already_used” or something like that would make more sense than a generic “invalid_grant” error.

1 Like