Start Authentication (formerly "Authentication - Step 1") is always shown. We do not check the credentials when rendering the page. Besides, it may be the case that you want to retry connecting, or connect with a different account.
Interestingly, the tokens I got from reauthenticating the first site (which triggered my ticket) worked fine yesterday. Today they failed.
The access token is ephemeral; pay no attention to it. The refresh token is the semi-permanent one. When there is no access token, or the existing access token no longer authenticates, your site contacts Google Drive through the mediator (by default our site) to exchange the refresh token with a new access token. Sometimes, you also get a new refresh token, in which case it is persisted to the database.
If the exchange does NOT return a new refresh token, the previously used refresh token can be reused. As I said, it used to be the case that this refresh token would never be rotated on Google's side which is exactly what allowed you to reuse the same refresh token across profiles and sites.
If the exchange DOES return a new refresh token, the previously used refresh token is "burnt". It can no longer be used by anyone or anything. Not the same backup profile, not a different backup profile, not a different site.
Since you were trying to reuse the same refresh token across profiles or sites, the first profile / site which used it in an exchange which resulted in a rotation won; it kept the new refresh token and it's working fine. Everything else kept the old, and now "burnt", refresh token which is no longer valid – hence the failure.
Again: every site, and every profile on each site, needs to have its own refresh token.
And here's where it gets weirder.
Google Drive MAY reject an otherwise valid refresh token if it thinks you created "too many", or it was "unused for a while", or for any other reason they deem necessary (think of it as fraud detection). They do not publish those limits and rules, they can change them whenever they want, and they may not even work the same for all accounts.
My experience is that all OAuth2-based consumer-grade storage services (Google Drive, OneDrive, Dropbox, Box) are NOT reliable when you have multiple backup profiles and/or sites. After a handful of backup profiles, you start getting random authentication problems. I have done nothing wrong; you can audit my code and see it follows their documentation to the letter. They decide to just "randomly" burn your refresh tokens, and by "randomly" I mean "it probably triggered some weird fraud detection algorithm". My advice is to use enterprise-grade storage for these use cases. It's not even that expensive. Services like Scaleway, BackBlaze B2, and Wasabi sell very inexpensive storage.
Nicholas K. Dionysopoulos
Lead Developer and Director
🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!