Starting in March 2021 the Google Chrome sync service can no longer be accessed by Chromium Browser builds.
There is, however, a little known work around that was still working at the time of this blog in February 2024.
Situation
Starting in March 2021 Google removed some API keys from the Chromium build repository to prevent 3rd party applications that were based on the Open Source Chromium builds from accessing certain API services which were considered to be Google applications only. One of the API keys removed was for the Chrome sync service.
This is particularly problematic for users of the Raspberry Pi Google users as the Chrome browser itself was/is not available for that platform. Thus users were/are no longer able to painlessly share a common set of bookmarks between their various platforms (Windows, Linux, Android, Apple).
Reason
This probably came about because a number of Googles competitors (including Microsoft) were now basing their own browsers on Google Chromium.
Solution
There is a little known work around for this problem which restores the ability to sync Chromium with a Chrome account. It should be noted that this work around is far from official and may disappear at some point in the future. However, at the time of writing this in February 2024 what is explained below was still working.
The problem is that a specific pair of API Key and Secret were removed from the build.
There are several different ways that I have found (by searching the internet) that get around this restriction. However, they don’t all work under all circumstances. Try each option until you find the one that works for your particular situation.
Option 1
Create a file called apikeys and input the following text into it:
# API keys assigned to Debian by Google for access to their services like sync and gmail.
export GOOGLE_API_KEY="AIzaSyCkfPOPZXDKNn8hhgu3JrA62wIgC93d44k"
export GOOGLE_DEFAULT_CLIENT_ID="811574891467.apps.googleusercontent.com"
export GOOGLE_DEFAULT_CLIENT_SECRET="kdloedMFGdGla2P1zacGjAQh"
Create another file called 00-rpi-vars and input the following text into it:
export CHROMIUM_FLAGS="$CHROMIUM_FLAGS --force-renderer-accessibility --enable-remote-extensions"
Then enter the following commands to change their permissions and put them in to the correct place in the system:
chmod 644 apikeys
chmod 644 00-rpi-vars
sudo chown root:root apikeys
sudo chown root:root 00-rpi-vars
sudo mv apikeys /etc/chromium.d/
sudo mv 00-rpi-vars /etc/chromium.d/
Login to your google account and then join this group:
https://groups.google.com/a/chromium.org/g/google-browser-signin-testaccounts/about
That’s it. If this option is going to work, this is all you need to do.
Option 2
A simple solution is make use of the ability to pass in that information on the command line at the time the browser is launched.
The command line to use is:
chromium --oauth2-client-id=77185425430.apps.googleusercontent.com --oauth2-client-secret=OTJgUOQcT7lO7GsGZq2G4IlT
The simplest way to make sure that this happens every time that the browser is invoked is to setup a keyboard shortcut in the GUI. In most Debian derived distributions this is achieved from the settings dialogue:
Settings | Keyboard | View and Customise Shortcuts | Custom Shortcuts
An example entry might be:
Name: Chromium web browser with google sync
Command: chromium --oauth2-client-id=77185425430.apps.googleusercontent.com --oauth2-client-secret=OTJgUOQcT7lO7GsGZq2G4IlT
Shortcut: Ctrl + Alt + W
Option 3
Another simple alternative on Debian Linux systems (including some Raspberry Pi OS versions) is to add the keys to a file in the /etc/chromium.d/ directory.
For example use an editor such as nano to create the following file:
sudo nano /etc/chromium.d/synckeys
and paste the following text in to it:
export CHROMIUM_FLAGS="$CHROMIUM_FLAGS --oauth2-client-id=77185425430.apps.googleusercontent.com"
export CHROMIUM_FLAGS="$CHROMIUM_FLAGS --oauth2-client-secret=OTJgUOQcT7lO7GsGZq2G4IlT"
This file will be sourced automatically every time that the Chromium browser is executed (no matter how it is executed).