Help with Azure's token - Fatal error: config failed to refresh token: Error: Auth Error

What is the problem you are having with rclone?

I can't get the token from Azure.

Fatal error: config failed to refresh token: Error: Auth Error
Code: ""
Description: No code returned by remote server

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

rclone v1.66.0

  • os/version: Microsoft Windows 11 Home Single Language 21H2 (64 bit)
  • os/kernel: 10.0.22000.2538 (x86_64)
  • os/type: windows
  • os/arch: amd64
  • go/version: go1.22.1
  • go/linking: static
  • go/tags: cmount

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

Microsoft OneDrive Personal
Trying for the first time. Until now I have always configured with Google Drive without problem

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

rclone config

Please run 'rclone config redacted' and share the full output. If you get command not found, please make sure to update rclone.

[rclone-restic-onedrive]
type = onedrive
client_id = XXX
client_secret = XXX

A log from the command that you were trying to run with the -vv flag

Paste  log here

When I open the browser to validate access I get the error

Fatal error: config failed to refresh token: Error: Auth Error
Code: ""
Description: No code returned by remote server

First time using Azure and the app configured with these permissions
https://imgur.com/a/0fj0NoV

Any suggestions on what could be happening?
Thank you

azure and onedrive are different backends.
are you trying to get a token from azure or from onedrive?

can you post the output of rclone config -vv

1 Like

Hello. Thanks for answering.

I'm trying to set up rclone with Onedrive Personal. I follow the configuration steps choosing Onedrive but I am stuck in obtaining the Client ID where the link directs me to azure and I don't have any experience there

  1. Open Microsoft Azure and then click New registration.
rclone config -vv
2024/05/12 12:26:49 DEBUG : rclone: Version "v1.66.0" starting with parameters ["rclone" "config" "-vv"]
2024/05/12 12:26:49 DEBUG : Using config file from "C:\\Users\\USER\\AppData\\Roaming\\rclone\\rclone.conf"
Current remotes:

Name                 Type
====                 ====
rclone-restic-onedrive  onedrive


e) Edit existing remote
n) New remote
d) Delete remote
r) Rename remote
c) Copy remote
s) Set configuration password
q) Quit config
e/n/d/r/c/s/q>

can follow the rclone docs at https://rclone.org/onedrive/#creating-client-id-for-onedrive-personal

1 Like

Yes, is the doc that I followed.
But when I run the code to obtain the Token, the browser opens with the Microsoft account credentials and gives me this error:

Failure!

Error: Auth Error

Description: No code returned by remote server

Maybe is something about the tenants ? (Once again, totally new on Azure)

just now, i followed the docs, and i was able to create and test a onedrive remote with client id.

start over, run rclone config -vv and create a new onedrive remote.
post the full output of that command.

could be an issue with the web browser.

when running rclone config -vv, at that point shown below,

  1. open a new web browser window in private mode.
  2. copy/paste URL into the address bar of the web browser.
  3. login to your onedrive account
Use web browser to automatically authenticate rclone with remote?
 * Say Y if the machine running rclone has a web browser you can use
 * Say N if running rclone on a (remote) machine without web browser access
If not sure try Y. If Y failed, try N.

y) Yes (default)
n) No
y/n>

NOTICE: If your browser doesn't open automatically go to the following link: 
http://127.0.0.1:53682/auth?state=K13AosvbYahJoX68Llh_vw
NOTICE: Log in and authorize rclone for access
NOTICE: Waiting for code...
1 Like

Thanks again for your time

start over, run rclone config -vv and create a new onedrive remote.
post the full output of that command.

Maybe is something with the region?
I choose 1 and I get

region> 1

2024/05/12 16:08:25 DEBUG : rclone-restic-onedrive: config in: state="*all-set,5,false", result="global"
2024/05/12 16:08:25 DEBUG : rclone-restic-onedrive: config out: out=&{State:*all,6,false Option: OAuth: Error: Result:}, err=
2024/05/12 16:08:25 DEBUG : rclone-restic-onedrive: config in: state="*all,6,false", result=""
2024/05/12 16:08:25 DEBUG : rclone-restic-onedrive: config out: out=&{State:*all,7,false Option: OAuth: Error: Result:}, err=
2024/05/12 16:08:25 DEBUG : rclone-restic-onedrive: config in: state="*all,7,false", result=""
2024/05/12 16:08:25 DEBUG : rclone-restic-onedrive: config out: out=&{State:*all,8,false Option: OAuth: Error: Result:}, err=
2024/05/12 16:08:25 DEBUG : rclone-restic-onedrive: config in: state="*all,8,false", result=""
2024/05/12 16:08:25 DEBUG : rclone-restic-onedrive: config out: out=&{State:*all,9,false Option: OAuth: Error: Result:}, err=
2024/05/12 16:08:25 DEBUG : rclone-restic-onedrive: config in: state="*all,9,false", result=""
2024/05/12 16:08:25 DEBUG : rclone-restic-onedrive: config out: out=&{State:*all,10,false Option: OAuth: Error: Result:}, err=
2024/05/12 16:08:25 DEBUG : rclone-restic-onedrive: config in: state="*all,10,false", result=""
2024/05/12 16:08:25 DEBUG : rclone-restic-onedrive: config out: out=&{State:*all,11,false Option: OAuth: Error: Result:}, err=
2024/05/12 16:08:25 DEBUG : rclone-restic-onedrive: config in: state="*all,11,false", result=""
2024/05/12 16:08:25 DEBUG : rclone-restic-onedrive: config out: out=&{State:*all,12,false Option: OAuth: Error: Result:}, err=
2024/05/12 16:08:25 DEBUG : rclone-restic-onedrive: config in: state="*all,12,false", result=""
2024/05/12 16:08:25 DEBUG : rclone-restic-onedrive: config out: out=&{State:*all,13,false Option: OAuth: Error: Result:}, err=
2024/05/12 16:08:25 DEBUG : rclone-restic-onedrive: config in: state="*all,13,false", result=""
2024/05/12 16:08:25 DEBUG : rclone-restic-onedrive: config out: out=&{State:*all,14,false Option: OAuth: Error: Result:}, err=
2024/05/12 16:08:25 DEBUG : rclone-restic-onedrive: config in: state="*all,14,false", result=""
2024/05/12 16:08:25 DEBUG : rclone-restic-onedrive: config out: out=&{State:*all,15,false Option: OAuth: Error: Result:}, err=
2024/05/12 16:08:25 DEBUG : rclone-restic-onedrive: config in: state="*all,15,false", result=""
2024/05/12 16:08:25 DEBUG : rclone-restic-onedrive: config out: out=&{State:*all,16,false Option: OAuth: Error: Result:}, err=
2024/05/12 16:08:25 DEBUG : rclone-restic-onedrive: config in: state="*all,16,false", result=""
2024/05/12 16:08:25 DEBUG : rclone-restic-onedrive: config out: out=&{State:*all,17,false Option: OAuth: Error: Result:}, err=
2024/05/12 16:08:25 DEBUG : rclone-restic-onedrive: config in: state="*all,17,false", result=""
2024/05/12 16:08:25 DEBUG : rclone-restic-onedrive: config out: out=&{State:*all,18,false Option: OAuth: Error: Result:}, err=
2024/05/12 16:08:25 DEBUG : rclone-restic-onedrive: config in: state="*all,18,false", result=""
2024/05/12 16:08:25 DEBUG : rclone-restic-onedrive: config out: out=&{State:*all,19,false Option: OAuth: Error: Result:}, err=
2024/05/12 16:08:25 DEBUG : rclone-restic-onedrive: config in: state="*all,19,false", result=""
2024/05/12 16:08:25 DEBUG : rclone-restic-onedrive: config out: out=&{State:*all,20,false Option: OAuth: Error: Result:}, err=
2024/05/12 16:08:26 DEBUG : rclone-restic-onedrive: config in: state="*all,20,false", result=""
2024/05/12 16:08:26 DEBUG : rclone-restic-onedrive: config out: out=&{State:*all,21,false Option: OAuth: Error: Result:}, err=
2024/05/12 16:08:26 DEBUG : rclone-restic-onedrive: config in: state="*all,21,false", result=""
2024/05/12 16:08:26 DEBUG : rclone-restic-onedrive: config out: out=&{State:*all,22,false Option: OAuth: Error: Result:}, err=
2024/05/12 16:08:26 DEBUG : rclone-restic-onedrive: config in: state="*all,22,false", result=""
2024/05/12 16:08:26 DEBUG : rclone-restic-onedrive: config out: out=&{State:*all,23,false Option: OAuth: Error: Result:}, err=
2024/05/12 16:08:26 DEBUG : rclone-restic-onedrive: config in: state="*all,23,false", result=""
2024/05/12 16:08:26 DEBUG : rclone-restic-onedrive: config out: out=&{State:*all,24,false Option: OAuth: Error: Result:}, err=
2024/05/12 16:08:26 DEBUG : rclone-restic-onedrive: config in: state="*all,24,false", result=""
2024/05/12 16:08:26 DEBUG : rclone-restic-onedrive: config out: out=&{State:*all,25,false Option: OAuth: Error: Result:}, err=
2024/05/12 16:08:26 DEBUG : rclone-restic-onedrive: config in: state="*all,25,false", result=""
2024/05/12 16:08:26 DEBUG : rclone-restic-onedrive: config out: out=&{State:*all-advanced Option:false OAuth: Error: Result:}, err=
2024/05/12 16:08:26 DEBUG : rclone-restic-onedrive: config: reading config parameter "config_fs_advanced"

If I continue anyway when it asks me to authenticate

2024/05/12 16:10:08 DEBUG : rclone-restic-onedrive: config in: state="*all-advanced", result="false"
2024/05/12 16:10:08 DEBUG : rclone-restic-onedrive: config out: out=&{State:*postconfig Option: OAuth: Error: Result:}, err=
2024/05/12 16:10:08 DEBUG : rclone-restic-onedrive: config in: state="*postconfig", result=""
2024/05/12 16:10:08 DEBUG : rclone-restic-onedrive: config in: state="", result=""
2024/05/12 16:10:08 DEBUG : rclone-restic-onedrive: config out: out=&{State:*oauth,choose_type,, Option: OAuth: Error: Result:}, err=
2024/05/12 16:10:08 DEBUG : rclone-restic-onedrive: config out: out=&{State:*oauth,choose_type,, Option: OAuth: Error: Result:}, err=
2024/05/12 16:10:08 DEBUG : rclone-restic-onedrive: config in: state="*oauth,choose_type,,", result=""
2024/05/12 16:10:08 DEBUG : rclone-restic-onedrive: config out: out=&{State:*oauth-confirm,choose_type,, Option: OAuth: Error: Result:}, err=
2024/05/12 16:10:08 DEBUG : rclone-restic-onedrive: config in: state="*oauth-confirm,choose_type,,", result=""
2024/05/12 16:10:08 DEBUG : rclone-restic-onedrive: config out: out=&{State:*oauth-islocal,choose_type,, Option:true OAuth: Error: Result:}, err=
2024/05/12 16:10:08 DEBUG : rclone-restic-onedrive: config: reading config parameter "config_is_local"
Use web browser to automatically authenticate rclone with remote?

  • Say Y if the machine running rclone has a web browser you can use
  • Say N if running rclone on a (remote) machine without web browser access
    If not sure try Y. If Y failed, try N.

Copying the link and pasting it into a private Window also does not allow me to validate
I tried with Google Chrome and also with Brave

2024/05/12 16:11:19 NOTICE: Config file "C:\Users\Administrator\AppData\Roaming\rclone\rclone.conf" not found - using defaults
2024/05/12 16:11:19 NOTICE: Make sure your Redirect URL is set to "http://localhost:53682/" in your custom config.
2024/05/12 16:11:19 NOTICE: If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth?state=9abY5BYOrR1gt_6E3oaKgA
2024/05/12 16:11:19 NOTICE: Log in and authorize rclone for access
2024/05/12 16:11:19 NOTICE: Waiting for code...
Error: config failed to refresh token: Error: Auth Error
Code: ""
Description: No code returned by remote server
Help:
Usage:
rclone authorize [flags]

Thank you very much for your help. I decided to use Backblaze and iDrive e2 and found the setups much easier. I guess that's because they are e2.

Moderators can close this post. Thank you so much

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