1

I've built a Google Sheets oAuth flow, and it's working most of the time.

When it's successful, it returns a refresh token and access token. I'm able to successfully use the refresh to generate new access tokens, but that is not my issue.

I've noticed that once a refresh token is issued for a specific Google account, I'm unable to use it again to test the oAuth flow. I can complete the steps, but it stops returning the refresh token in the response if it's already been issued.

This is really just making it hard to actually test my application, since once I've used an email I'm unable to test with it again.

Does anyone have any recommendations for how to successfully test repeatedly, without needing to generate a ton of real email accounts?

Thanks for any ideas,

Patrick

Edit: Found answer in this thread: Not receiving Google OAuth refresh token

TLDR: I needed to add prompt=consent to the auth URL in order to force the refresh token to come back every time after the first auth.

user3689720
  • 181
  • 2
  • 11
  • Probably a bug or you're doing something wrong. Did you set `offline` scope? – TheMaster Jul 08 '22 at 21:04
  • Can you post a code sample or the error you get when trying to use the token? Refresh tokens are long-lived, and only expire in a few specific scenarios or within 7 days if your app is still in testing status. You should be able to just keep reusing it. – Daniel Jul 08 '22 at 21:49

0 Answers0