[OneDrive] Own token - authentication failed during setup

What is the problem you are having with rclone?

I want to setup Rclone with a personal OneDrive account using my own client ID and key on an headless machine. the configuration of the token fails. I followed the documentation Microsoft OneDrive as well as this thread Onedrive - Can't authenticate with own cliend id - #4 by Cilix on the forum

What is your rclone version (output from rclone version)

rclone v1.55.1

  • os/type: linux
  • os/arch: amd64
  • go/version: go1.16.4
  • go/linking: dynamic
  • go/tags: none

Which OS you are using and how many bits (eg Windows 7, 64 bit)

Arch Linux 64bits

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


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

$ rclone authorize "onedrive" -- "Application (client) ID" "Value of the Client secret"

The rclone config contents with secrets removed.

Not applicable as the config is in progress

A log from the command with the -vv flag

$ rclone -vv authorize "onedrive" -- "Application (client) ID" "Value of the Client secret"
2021/07/10 15:23:35 DEBUG : Using config file from "/home/admin/.config/rclone/rclone.conf"
2021/07/10 15:23:35 DEBUG : rclone: Version "v1.55.1" starting with parameters ["rclone" "-vv" "authorize" "onedrive" "--" "Application (client) ID" "Value of the Client secret"]
Make sure your Redirect URL is set to "http://localhost:53682/" in your custom config.
2021/07/10 15:23:35 DEBUG : Starting auth server on
If your browser doesn't open automatically go to the following link:
Log in and authorize rclone for access
Waiting for code...
2021/07/10 15:23:55 DEBUG : Redirecting browser to: https://login.microsoftonline.com/common/oauth2/v2.0/authorize?access_type=offline&client_id=Application (client) ID&redirect_uri=http%3A%2F%2Flocalhost%3A53682%2F&response_type=code&scope=Files.Read+Files.ReadWrite+Files.Read.All+Files.ReadWrite.All+offline_access+Sites.Read.All&state=hKir66_U-K2jwq4cgZ4_pw
2021/07/10 15:23:58 DEBUG : Received GET request on auth server to "/"
2021/07/10 15:23:58 DEBUG : Closing auth server
2021/07/10 15:23:58 DEBUG : Closed auth server with error: accept tcp use of closed network connection
2021/07/10 15:23:58 Failed to configure token: Error: Auth Error
Code: ""
Description: No code returned by remote server

I tested without my own token and it works so it is really an authentication issue.

Thanks for your help!

After deleting the app, recreating it and setting-up the secrets again in Azure, it worked after the 3rd trial. I don't think I will ever know what happened.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.