Make your own ClientID for Google Drive sync on KDE - This works!

This is a bit of an involved process, but don't worry, it's doable.

I've made this guide because I had to piece some steps together from a few other sources.

There was also a step that nobody mentioned, which I had to realise for myself.

Hand-holding is exactly how I learned to use & configure & fix Linux, so I shall do the same for you — there's no shame in this, despite how loudly half the Linux community will shout you down when you ask for help.

THIS IS FOR KDE and RCLONE ONLY

Sources

Steps

1

If you've already tried to log in to your Google account in KDE, delete the account from the Online Accounts.

We're going to modify the connection parameters, so you'll need to connect your account afresh.

Moreover, it appears that KDE's Online Accounts only allows for one Google account connection, which seems a bit odd but whatever.

2

Log in to the Google API Console

Here: https://console.developers.google.com/

Any account is fine, doesn't need to be the same one as the Drive account you want to access.

3

Create a new project

Call it whatever you like.

Don't worry about the "no organisation" bit.

Click Create.

4

Go to the APIs & Services dashboard

why but the APIs link wasn't visible anywhere.

Click here to go to the dashboard: https://console.cloud.google.com/apis/dashboard

Then click "Enable APIs and services" at the top,

OR click here to go directly to the API Library:

Google Cloud API Library

5

Enable the Google Drive API

Scroll down to find it, you should see this. Click it.

If you have more than one Google Cloud project, double-check at the top of the page that you are in the right project! It's a button next to the Google Cloud heading:

Then click the blue "Enable button":

6

Go to the OAuth Consent Screen in the sidebar menu, or click this button:

OAuth Management

Click the Get started button:

a) App Information

Type a name for the app. This doesn't really matter because only you are going to see this, when you log in to your Google account through KDE.

Add your email address by just clicking in the box. You can only choose your address.

Click Next.

b) Audience

Choose Internal or External.

I don't think this matters too much, because Internal means that only you (and your organisation, if you have Google Workspace) can access it; and External means that people can only use it if you've added them to the list of test users. Others won't be able to use it unless you have "verified" your app, which is hard so no worries there. Regardless, even if others can use it, they'll still only be connecting to their Google account.

NOTE

"Internal" is the better choice as long as the Google Drive you want to connect to is part of the same Google Workspace as this Cloud project. If you are an individual Google account user then this is fine.

"External" will require you to either:

a) publish the project, which is a lengthy, complicated and arduous process, with a bunch of verification hoops, awaiting a Google employee to verify your project;

b) keep the project in "testing" mode, which will expire after 1 week so you'll have to keep logging in to your Google account in KDE once a week.

Choose Internal.

​c) Contact Information

Just add your email address here.

d) Finish and Create

Check the "I agree" box, click Continue, then click Create.

7

Data Access — add scopes

Click Data access in the sidebar or click this button:

Data access

Remember to check that you're in the right project if you have more than one.

Now you have to add "scopes" — these are aspects of the data in your Google account that you want to access. For security, the Google Cloud API only allows access to the aspects of your data that have been explicitly defined and requested.

Click the Add or remove scopes button.

There are around 250 available scopes in this list, so do use the Filter at the top of the table if necessary.

Note that typing something into the filter box does not select the scope that appears! The behaviour of the filter is a bit strange. After pressing Enter in the search filter, you also have to the checkboxes next to each scope that you need.

In this filter box, search for each of these scope names:

  • userinfo.email

  • userinfo.profile

  • docs

  • drive

  • drive.metadata.readonly

You may add more if you think they are necessary.

The default /usr/share/accounts/providers/kde/google.provider file also contains the scopes calendar, tasks, youtube.upload and m8/feeds. It seems that these work automatically and don't need to be added in our custom Google Cloud project.

CLICK THE BLUE UPDATE BUTTON!!!

For some reason it is possible to click outside of the popup scope panel and it will close automatically, losing all the changes that you made. So click that UPDATE button!

Finally click the blue Save button.

8

Add yourself as a user

Click Audience in the sidebar, or click this button:

Audience

Scroll down to Test users and click + Add users.

Add your Google account email address (the one that you type when you sign in to your Google account) and click Save.

Only Google accounts listed in here will be able to sign in using the ClientID that we're creating.

9

Create OAuth client

Go to the Overview in the sidebar, then click Create OAuth client in the Metrics section; or click this button to go there directly:

Create OAuth client

Choose Desktop app as application type, and give it a name (or keep the default, it doesn't matter — this is only for you to identify it in your Cloud projects console).

A panel will appear, THIS IS VERY IMPORTANT!

"OAuth client created"

Here, you must Download JSON to save your Client ID and Client Secret because if you don't, you will not be able to access your Client Secret again!!! (However, I actually was able to. But Google are liable to change anything at any time so download it!)

After download the JSON file and saving it somewhere safe, copy and paste the ID and the Secret somewhere handy because you're about to use these in a configuration file on your computer.

10

Back up your Google.Provider file

HERE BE DRAGONS

Go to /usr/share/accounts/providers/ in your file browser. I recommend Dolphin because it handles root/superuser access like a boss, instead of the class clown Gnome Files.

/usr/share/accounts/providers/

Right click on the kde folder and click "open as adminstrator".

(You can also just press Ctrl+Alt+Shift+A to switch to adminstrator mode!)

Inside the kde folder, right click on the file google.provider and choose Duplicate here, or press Ctrl+D.

Rename the backup version to whatever you want so that you remember what it is.

Now open the google.provider file in a text editor. Or you can do all this through command line, but there's a lot of copying and pasting of messy strings of characters so I prefer a GUI.

I recommend Kate text editor because, again, it actually handles root/superuser requests properly, unlike the Gnome counterpart.

POTENTIALLY OUTDATED

I wrote this guide in October 2025, so proceed from here with caution.

There are two ways you can go:

  1. Copy and paste the whole file, and add your client ID and secret.

  2. Edit the file contents manually.

Option 2 is better if you are reading this from the distant future. (In the Linux world, things change very fast so that could be any time after October 2025 🙃).

11

Put the ClientID into your system

Option 1: Copy and paste the whole file

<?xml version="1.0" encoding="UTF-8"?>
<provider id="google">
  <name>Google</name>

  <description>NAME configured this - Sync 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&amp;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/youtube.upload',
            'https://www.googleapis.com/auth/docs',
            'https://www.googleapis.com/auth/drive',
            'https://www.googleapis.com/auth/drive.metadata.readonly'
            ]</setting>
          <setting type="as" name="AllowedSchemes">['https']</setting>
          <setting name="ClientId">CLIENT_ID_HERE</setting>
          <setting name="ClientSecret">CLIENT_SECRET_HERE</setting>
        </group>
      </group>
    </group>
  </template>
</provider>

1. Copy and paste the above block, and replace the following with your own:

  • NAME = put your name here. This will appear in the Add Accounts panel when you add your Google account.

  • CLIENT_ID_HERE = paste your Client ID. No quote marks around it.

  • CLIENT_SECRET_HERE = paste your Client Secret. No quote marks around it.

2. Save the file.

Option 2: Edit the file manually

1. In the section <setting type="as" name="Scope">, add the following URLs if they aren't already there:

  • https://www.googleapis.com/auth/userinfo.email

  • https://www.googleapis.com/auth/userinfo.profile

  • https://www.googleapis.com/auth/docs

  • https://www.googleapis.com/auth/drive

  • https://www.googleapis.com/auth/drive.metadata.readonly

Ensure that each is wrapped with a quote mark ' , and that every line is ended with a comma , except for the last line.

2. Replace the ClientID with yours in the tag <setting name="ClientId">.

3. Replace the Client Secret with yours in the tag <setting name="ClientSecret">.

4. Edit the <description> tag so that you can see it in the Add accounts panel in KDE.

5. Save the file.

12

Add your Google account to KDE's Online Accounts

The shortest route to do this is:

  1. Open Dolphin

  2. Click Network in the sidebar

  3. Click Google Drive in the main panel

  4. Click + Add Account... in the Online Accounts window that appears

Choose your Google service from the list.

If you kept both google.provider files with the .provider file suffix, then both of them will show up in the add accounts list. You can't do this, because the .provider file MUST be called google.provider exactly, with no additional characters whatsoever. The process appears to work, but the end result is that you log in but can't actually access anything from your Google account. I have no idea why this is but I can only assume it's something hard-coded into the KDE online accounts backend/service.

Your customised file must be called google.provider.

I've kept the following screenshot so that you can see where your edited strings will appear.

Here you will see the name of your app that you typed in Step 6:

Sign in, choose your account, etc.

If you opted for the "External" audience type, and you haven't had your app verified (of course you haven't, it's a crazy process), you will be greeted with this scary screen.

Presumably you trust yourself, and you've been following along with this whole process, so you should understand that there aren't any risks here — you are simply connecting to your own Google account.

Click Advanced in the window, then click on the tiniest text, "Go to APP NAME (unsafe)":

You'll notice that this list is a list of the scopes that we added as scope URLs in the Data Access section (Step 7) and the google.provider file on your computer.

Check the box next to Select all.

Finally, in your online accounts settings, click on your new account and you should see this:

Open the Network item from the sidebar in Dolphin again, choose Google Drive, and you should see your account there.

Open it and.. wait...

And you should see this:

Congratulations! You have successfully set up your very own Google Drive Sync system.

And hopefully you learned a bunch about a bunch along the way. 🥳

💧 drink some water 💧

Last updated