I’m using a custom ~/.local/share/accounts/providers/google.provider
that enables access to Google Drive. It’s tied to an OAuth client that I set up on my Google account. Against all odds, this works, which is nice.
Here's the config
<?xml version="1.0" encoding="UTF-8"?>
<provider id="google">
<name>Google</name>
<description>Sync files, calendars, contacts, and tasks, and upload videos to YouTube in supported apps</description>
<icon>im-google</icon>
<translations>kaccounts-providers</translations>
<domains>.*google\.com</domains>
<template>
<group name="auth">
<setting name="method">oauth2</setting>
<setting name="mechanism">web_server</setting>
<group name="oauth2">
<group name="web_server">
<setting name="Host">accounts.google.com</setting>
<setting name="AuthPath">o/oauth2/auth?access_type=offline&approval_prompt=force</setting>
<setting name="TokenPath">o/oauth2/token</setting>
<setting name="RedirectUri">http://localhost/oauth2callback</setting>
<setting name="ResponseType">code</setting>
<setting type="as" name="Scope">[
'https://www.googleapis.com/auth/userinfo.email',
'https://www.googleapis.com/auth/userinfo.profile',
'https://www.googleapis.com/auth/calendar',
'https://www.googleapis.com/auth/tasks',
'https://www.google.com/m8/feeds/',
'https://www.googleapis.com/auth/drive',
'https://www.googleapis.com/auth/youtube.upload'
]</setting>
<setting type="as" name="AllowedSchemes">['https']</setting>
<setting name="ClientId">REDACTED</setting>
<setting name="ClientSecret">REDACTED</setting>
<setting type="b" name="ForceClientAuthViaRequestBody">true</setting>
</group>
</group>
</group>
</template>
</provider>
At first, I can log in as myself, access files, etc. However, after a week or two of not using it, I get this error in Dolphin when I try to open the drive:
Expired or missing access tokens for account REDACTED
I seem to remember seeing a notification the first time this happened that told me to reauthenticate in the Online Accounts kcm, but there’s no indication that the account is broken and no option (that I can find) to reauthenticate.
The first time this happened, I removed and re-added the account, but it has now happened again and I’m wondering if there’s a way to avoid this altogether. Thanks!