Using Google Drive official app auth for Rclone config

STOP and READ USE THIS TEMPLATE NO EXCEPTIONS - By not using this, you waste your time, our time and really hate puppies. Please remove these two lines and that will confirm you have read them.

What is the problem you are having with rclone?

Configuring rclone gdrive, but forbidden

Run the command 'rclone version' and share the full output of the command.

rclone v1.64.2

  • os/version: ubuntu 24.04 (64 bit)
  • os/kernel: 6.8.0-1018-aws (x86_64)
  • os/type: linux
  • os/arch: amd64
  • go/version: go1.21.3
  • go/linking: static
  • go/tags: none

Which cloud storage system are you using? (eg Google Drive)

Google Drive

The command you were trying to run (eg rclone copy /tmp remote:tmp)

Rclone config

So, when I try to perform authentication

root@ip-172-31-28-163:~# rclone config
Current remotes:

Name                 Type
====                 ====
bsvault              drive
gdperm               drive
ikhwanperwira@*** drive

e) Edit existing remote
n) New remote
d) Delete remote
r) Rename remote
c) Copy remote
s) Set configuration password
q) Quit config
e/n/d/r/c/s/q> e

Select remote.
Choose a number from below, or type in an existing value.
 1 > bsvault
 2 > gdperm
 3 > ikhwanperwira@***
remote> 3

Editing existing "ikhwanperwira@***" remote with options:
- type: drive
- scope: drive

Option client_id.
Google Application Client Id
Setting your own is recommended.
See https://rclone.org/drive/#making-your-own-client-id for how to create your own.
If you leave this blank, it will use an internal key which is low performance.
Enter a value. Press Enter to leave empty.
client_id>

Option client_secret.
OAuth Client Secret.
Leave blank normally.
Enter a value. Press Enter to leave empty.
client_secret>

Option scope.
Scope that rclone should use when requesting access from drive.
Choose a number from below, or type in your own string value.
Press Enter for the default (drive).
 1 / Full access all files, excluding Application Data Folder.
   \ (drive)
 2 / Read-only access to file metadata and file contents.
   \ (drive.readonly)
   / Access to files created by rclone only.
 3 | These are visible in the drive website.
   | File authorization is revoked when the user deauthorizes the app.
   \ (drive.file)
   / Allows read and write access to the Application Data folder.
 4 | This is not visible in the drive website.
   \ (drive.appfolder)
   / Allows read-only access to file metadata but
 5 | does not allow any access to read or download file content.
   \ (drive.metadata.readonly)
scope> 1

Option service_account_file.
Service Account Credentials JSON file path.
Leave blank normally.
Needed only if you want use SA instead of interactive login.
Leading `~` will be expanded in the file name as will environment variables such as `${RCLONE_CONFIG_DIR}`.
Enter a value. Press Enter to leave empty.
service_account_file>

Edit advanced config?
y) Yes
n) No (default)
y/n> n

Use web browser to automatically authenticate rclone with remote?
 * Say Y if the machine running rclone has a web browser you can use
 * Say N if running rclone on a (remote) machine without web browser access
If not sure try Y. If Y failed, try N.

y) Yes (default)
n) No
y/n> N

Option config_token.
For this to work, you will need rclone available on a machine that has
a web browser available.
For more help and alternate methods see: https://rclone.org/remote_setup/
Execute the following on the machine with the web browser (same rclone
version recommended):
        rclone authorize "drive" "eyJzY29wZSI6ImRyaXZlIn0"
Then paste the result.
Enter a value.

The workspace admin didn't allow it:


But, it's allowed when using Google Drive app official for windows:


So, I'm planning to use Google Drive official app authentication for the rclone config

How to do that?

that is a very old version, should update to latest and test again.


the app has nothing to do with rclone.


why did you choose No instead of Yes?

I chose No because I was on CLI environment.

I updated:

root@general-instance:~# rclone --version
rclone v1.69.3
- os/version: ubuntu 24.04 (64 bit)
- os/kernel: 6.11.0-1015-gcp (x86_64)
- os/type: linux
- os/arch: amd64
- go/version: go1.24.3
- go/linking: static
- go/tags: none

Still same error

run that using -vv
or
Configuring by copying the config file

either way, need to alway use -vv for debug ouput and post full output.

Here:

PS C:\Users\User> rclone authorize "drive" "eyJzY29wZSI6ImRyaXZlLnJlYWRvbmx5In0" -vv
2025/06/09 05:43:47 DEBUG : rclone: Version "v1.68.1" starting with parameters ["C:\\Program Files\\rclone-v1.68.1-windows-amd64\\rclone.exe" "authorize" "drive" "eyJzY29wZSI6ImRyaXZlLnJlYWRvbmx5In0" "-vv"]
2025/06/09 05:43:47 DEBUG : **temp-fs**: config in: state="", result=""
2025/06/09 05:43:47 DEBUG : Using config file from "C:\\Users\\User\\AppData\\Roaming\\rclone\\rclone.conf"
2025/06/09 05:43:47 DEBUG : OAuth only is set - overriding return state
2025/06/09 05:43:47 DEBUG : **temp-fs**: config out: out=&{State:*oauth,,, Option:<nil> OAuth:<nil> Error: Result:}, err=<nil>
2025/06/09 05:43:47 DEBUG : **temp-fs**: config in: state="*oauth,,,", result=""
2025/06/09 05:43:47 DEBUG : **temp-fs**: config out: out=&{State:*oauth-confirm,,, Option:<nil> OAuth:<nil> Error: Result:}, err=<nil>
2025/06/09 05:43:47 DEBUG : **temp-fs**: config in: state="*oauth-confirm,,,", result=""
2025/06/09 05:43:47 DEBUG : Auto confirm is set, choosing default "true" for state "*oauth-islocal,,,", override by setting config parameter "config_is_local"
2025/06/09 05:43:47 DEBUG : **temp-fs**: config out: out=&{State:*oauth-islocal,,, Option:<nil> OAuth:<nil> Error: Result:true}, err=<nil>
2025/06/09 05:43:47 DEBUG : **temp-fs**: config in: state="*oauth-islocal,,,", result="true"
2025/06/09 05:43:47 DEBUG : **temp-fs**: config out: out=&{State:*oauth-do,,, Option:<nil> OAuth:<nil> Error: Result:}, err=<nil>
2025/06/09 05:43:47 DEBUG : **temp-fs**: config in: state="*oauth-do,,,", result=""
2025/06/09 05:43:47 DEBUG : Starting auth server on 127.0.0.1:53682
2025/06/09 05:43:47 NOTICE: If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth?state=BxBBSb_YctO3fKGK5eHulA
2025/06/09 05:43:47 NOTICE: Log in and authorize rclone for access
2025/06/09 05:43:47 NOTICE: Waiting for code...
2025/06/09 05:43:47 DEBUG : Redirecting browser to: https://accounts.google.com/o/oauth2/auth?access_type=offline&client_id=202264815644.apps.googleusercontent.com&redirect_uri=http%3A%2F%2F127.0.0.1%3A53682%2F&response_type=code&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdrive.readonly&state=BxBBSb_YctO3fKGK5eHulA

ok, now finish the steps from the rclone docs.

Still the same

I think the issue is because my google account is workspace account. So the admin blocked it. But the official Google Drive app works fine when performing authenticating through browser.

So that I think taking the client id and client secret of official google drive app and put it into rclone config will work