How to create and use a Google Drive client ID

#1

Having noticed advice on the forum, particularly from @Animosity022, to use your own client ID, I have followed the instructions here:
https://rclone.org/drive/#making-your-own-client-id

I have generated a client ID and client secret, and added them to the corresponding lines at the start of my rclone.conf file, in place of the # signs here:
[gdrive]
type = drive
client_id = #################
client_secret = ##############

But when I run my rclone sync command, it runs for about a minute and exits. The log file shows repeated entries like this:

2019/04/16 13:53:29 DEBUG : gdrive: Loaded invalid token from config file - ignoring
2019/04/16 13:53:29 DEBUG : gdrive: Token refresh failed try 1/5: oauth2: cannot fetch token: 401 Unauthorized
Response: {
“error”: “unauthorized_client”,
“error_description”: “Unauthorized”
}

and finally an error:

2019/04/16 13:54:28 ERROR : : error reading destination directory: couldn’t list directory: Get https://www.googleapis.com/drive/v3/files?alt=json&fields= blah, blah , blah… : oauth2: cannot fetch token: 401 Unauthorized
Response: {
“error”: “unauthorized_client”,
“error_description”: “Unauthorized”
}

I’d be very grateful for advice about what I’m doing wrong and how to fix it.

#2

You need to run rclone config and add them that way as you missed doing the last step:

#3

Thanks for the quick reply. I’ve run rclone config, and added the ID and secret to my existing remote, but I still get the same errors.

The rclone.conf file shows the client ID and the client secret, as I’ve entered them via the rclone config dialogue. The next line in rclone.conf is

token = {“access_token”:“ya29…blah,blah…”,“expiry”:“2019-04-14T21:47:18.761722421+01:00”}

which I think is the expired token that the log shows rclone trying, and failing, to refresh.

Any thoughts?

#4

Or just run another authorize.

#5

If you ran rclone config and entered in your information, it should have asked you to refresh the token to authorize it. Did you do that?

image

1 Like
#6

Rats! Didn’t clock what that was about. Done now, and all working brilliantly, and lightning fast!

Many thanks for your great patience!

mac

1 Like
#7

Awesome!

Just making sure we didn’t miss something along the way and happy you got it fixed!