1

I'm unable to configure gdrive for rclone, giving 400 error.

enter image description here

enter image description here

enter image description here

enter image description here

Rubén
  • 34,714
  • 9
  • 70
  • 166
Sirish K
  • 11
  • 2
  • Isn't a 400 a formatting error and not an Authorization error? – eimmer May 02 '22 at 13:21
  • Please provide enough code so others can better understand or reproduce the problem. – Community May 02 '22 at 17:43
  • Just trying to configure gdrive with rclone, during the configuration process after giving the clien ID and client secret got a link to generate a Authorization code but when I browse that link I'm getting Authorization error You can't sign in to this app because it doesn't comply with Google's OAuth 2.0 policy for keeping apps secure. – Sirish K May 03 '22 at 03:34

1 Answers1

1

According to this post this error message may be caused by using an old version of rclone. Try installing the latest version if you haven't already done that.

Also you shouldn't post your client ID and secret. You should revoke them and re-create them.

I am using rclone 1.60, I still got the same error but I fixed it. You need to add rclone's Redirect URL to the Authorized redirect URIs section of the OAuth 2.0 Client ID that you created for rclone (in the Google API console).

First create your own client ID as described on the rclone website. Make sure it has a secret - click 'Reset Secret' if it doesn't. Remember to save after creating the secret.

Then you need to get the redirect URL:

  1. Start rclone config and proceed through the wizard, giving it the client ID and the secret when it asks for it.
  2. Continue with rclone config until it gets to the auto config part of the wizard (Use auto config?). Answer 'n' to this question.
  3. In its output rclone gives you a command to execute that looks like this: clone authorize "drive" "XXXX". Execute that command in another terminal session.
  4. The rclone authorize command will cause the Google Accounts page to be opened, which gets the error message Error 400: redirect_uri_mismatch
  5. In the rclone output is this text: Make sure your Redirect URL is set to "http://127.0.0.1:53682/"

Now you need to add the redirect URL to the Client ID's Authorized redirect URIs.

  1. Go to the Google API console
  2. Click on 'Credentials' in the left part of the screen.
  3. Click on Client ID in the section 'OAuth 2.0 Client IDs'.
  4. Put the Redirect URL in the section 'Authorized redirect URIs' and click 'Save'.

Complete the authorization process:

  1. Go back to the rclone authorize session - in its output there will be a line that starts with 'If your browser doesn't open automatically...'. Follow the link in that line. The web page that opens will say 'Success!'.
  2. The rclone authorize session will have produced a token. Copy that token and paste it into the rclone config session (which is waiting for a token).
  3. Complete the wizard. The remote should be setup and working now.
  • This fixed a similar error for me. Contrary to rclone's setup instructions, you want to make the Oauth2 key of the "web application" type, not the desktop type, so you can enter the Redirect URL as you indicated. – Bigbio2002 May 26 '23 at 23:23