Google Drive OAuth with --non-interactive no longer works

What is the problem you are having with rclone?

I have integrated a non-interactive authentication flow in an application. Last week, the feature worked fine. This week, while testing it again, the OAuth flow fails with the follwing error:

Error 400: invalid_request

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

rclone v1.57.0
- os/version: ubuntu 20.04 (64 bit)
- os/kernel: 5.11.0-43-generic (x86_64)
- os/type: linux
- os/arch: amd64
- go/version: go1.17.2
- 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)

This was the command executed:

rclone config \
 --drive-client-id my id \
 --drive-client-secret my-secret \ 
 create my-remote drive \
 scope=drive.file \
 config_is_local=false  \
 client_id=my-id \ 
 client_secret=my-secret \ 
 --non-interactive

This results in the following output:

{
  "State": "*oauth-do,teamdrive,,",
  "Option": {
    "Name": "config_verification_code",
    "Help": "Verification code\n\nGo to this URL, authenticate then paste the code here.\n\nhttps://accounts.google.com/o/oauth2/auth?access_type=offline&client_id=my-client-id&redirect_uri=urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob&response_type=code&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdrive.file&state=P8JQn396xLw9KI0v6wXXXX\n",
    "Provider": "",
    "Default": "",
    "Value": null,
    "ShortOpt": "",
    "Hide": 0,
    "Required": true,
    "IsPassword": false,
    "NoPrefix": false,
    "Advanced": false,
    "Exclusive": false,
    "DefaultStr": "",
    "ValueStr": "",
    "Type": "string"
  },
  "Error": "",
  "Result": ""
}

When visiting the link, the error is displayed.

If I remove the --non-interactive flag, the login works fine, but I need it to be non-interactive.

The rclone config contents with secrets removed.

There is no config file yet, the command should create it.

Does anyone have an idea why the integration suddenly no longer works?

Sigh. I am getting the same thing.

I'm afraid google has deprecated the OOB workflow - see Change Google Remote OAuth - OOB Method has been deprecated. · Issue #6000 · rclone/rclone · GitHub

However the latest beta does have a fix for this and it will be released as 1.58 very soon.

That's what this is about! Thank you @ncw for the guidance. Looks like I need to refactor that authentication flow to match the new setup.

1 Like

Yes it is rather boring of Google to take the OOB method away as it is quite easy to use, but oh well, security and all that!

I'm still getting the same problem with both 1.59 beta and the stable 1.58

hello and welcome to the forum,

perhaps start a new topic, answer the help and support questions.
we can help you there.