Re: GDrive: Automatic refresh of oauth2 access token
"Norman J. Goldstein via Duplicity-talk" <[email protected]>
| Newsgroups | gmane.comp.sysutils.backup.duplicity.general |
|---|---|
| Message-ID | <[email protected]> |
I followed those instructions -- very clear, thanks. One addition I suggest is to mention: When setting up, the file at the end of the path, GOOGLE_CREDENTIALS_FILE, must not already exist. **** I did the setup for *My Drive based shared folder* and a regular account. My proejct is in testing mode (rather than published) at the recommendation of the Google verification guys -- my project is being used privately. Unfortunately, in testing mode, the access token expires every 7 days. I have started writing a separate python CLI to send the refresh token to Google to get back a valid access token, but am actually stuck at reading the credentials json file from disk :-). The API probably just needs some kind of initialization. I am pretty sure that duplicity could automate this by doing the refresh when it is needs to. In fact, the API is supposed to do this automatically when in offline mode: In paragraph: Refreshing an access token (offline access) https://developers.google.com/identity/protocols/oauth2/web-server#offline Any suggestions much appreciated. Norm On 2024-05-21 04:42, edgar.soldin--- via Duplicity-talk wrote: > hey Norman, > > On 19.05.2024 20:49, Norman J. Goldstein via Duplicity-talk wrote: >> Started backing up my system to MyDrive using duplicity with GDrive >> backend. As expected, after a week, access was denied. >> >> A common "problem" is the testing access token expires after 7 days. >> The good news, is that we are given a refresh token that allows us to >> either refresh our current access token, or get a new access token (I >> don't know which). This will happen automatically if the client >> library is set to "offline" access. Or, we can write a script to >> send Google the refresh token and get back a rejuvenated setup. >> >> Does duplicity have a way to help/enable this refreshing of access >> token? >> >> I tried publishing my "app", but, given my situation (private use), >> Google recommended to remain as testing. > > not currently using the backend, but rewrote the manpage section > https://duplicity.us/stable/duplicity.1.html#a-note-on-gdrive-backend > some time ago. afair the ways described there create permanent API keys. > > please correct me if that changed.. sunny regards ede/duply.net > > _______________________________________________ > Duplicity-talk mailing list > [email protected] > https://lists.nongnu.org/mailman/listinfo/duplicity-talk _______________________________________________ Duplicity-talk mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/duplicity-talk