Files synced but not visible in Google Drive web UI

Thanks for the fast response. Here’s what I’ve found so far…

Using the --drive-impersonate flag gets this response from Google Drive:

Response: {
  "error" : "unauthorized_client",
  "error_description" : "Client is unauthorized to retrieve access tokens using this method."
}

I tried giving the service account appropriate domain-wide authority to go into the drives of users in that domain, but kept getting the same error.

I’m working on this from a different angle now. I’m attempting to log in using regular Client ID + Client Secret credentials, no service account. I’m running into redirect uri mismatch problems right now.

I should mention that I’m setting up rclone on a remote/headless machine.

  1. When setting up the remote in rclone config I enter the Client ID and Client Secret.
  2. In my browser, I add http://127.0.0.1:53682 as an authorized redirect URI, as rlcone asked me to.
  3. In rclone, I type n since I’m on a headless machine and rclone gives me a link to copy/paste into my browser. However, this link’s redirect_uri is of the urn:xxxx:xx:oauth:2.0:xxx variety. This produces a 400 error when I go to the link in my browser. (Google’s message: “The redirect URI in the request, [redacted], can only be used by a Client ID for native application. It is not allowed for the WEB client type.”)
  4. Just to see what would happen, I replaced the value of the redirect_uri parameter with http%3A%2F%2F127.0.0.1%3A53682 (which us URL-encoded http://127.0.0.1:53682). Using this in the link takes me to Google Account login screen and allows me to authorize the app for access to Google Drive.
  5. Upon clicking Allow, I get redirected to http://127.0.0.1:53682 with two parameters: state and code. I tried copy-pasting the code value into rclone but it then responds with “Failed to configure token: failed to get token: oauth2: cannot fetch token: 400 Bad Request” Response: { "error" : "redirect_uri_mismatch" }.

That’s where I am now. Maybe I’m going about this all wrong but this is the closest I’ve come to getting this working.

Thanks again for your help.