[OneDrive] rclone 1.59 cannot decode token from 1.59 `rclone authorize`

What is the problem you are having with rclone?

So on rclone 1.56.0, the OneDrive backend changed the format of the token from raw { "token": "{\"access_token\":\"... to base64 encoded ones (whatever usually starts with eyJ0b2tlbi, note the difference from normal Microsoft JWTs that usually start with eyJ0eXAiOi). It would be normal for rclone 1.55 to be unable to decode 1.59 tokens, but it seems wrong if even 1.59 itself cannot decode 1.59 tokens from rclone authorize.

(For whoever has come through this: go to https://jwt.io, put the eyJ0b2tlbi-prefixed token in the "Encoded" area, and give the "Decoded header" to rclone.)

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

rclone v1.59.0
- os/version: arch (64 bit)
- os/kernel: 5.18.16-arch1-1 (x86_64)
- os/type: linux
- os/arch: amd64
- go/version: go1.18.3
- go/linking: dynamic
- go/tags: none

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

OneDrive (Global)

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

rclone -vv config reconnect profile:

The rclone config contents with secrets removed.

N/A since the profile hasn't been created.

A log from the command with the -vv flag

<7>DEBUG : rclone: Version "v1.59.0" starting with parameters ["rclone" "-vv" "config" "reconnect" "[REDACTED]:"]
<7>DEBUG : rclone: systemd logging support activated
<7>DEBUG : Using config file from "/home/[REDACTED]/.config/rclone/rclone.conf"
<7>DEBUG : [REDACTED]: config in: state="", result=""
<7>DEBUG : [REDACTED]: config out: out=&{State:*oauth,choose_type,, Option:<nil> OAuth:<nil> Error: Result:}, err=<nil>
<7>DEBUG : [REDACTED]: config in: state="*oauth,choose_type,,", result=""
<7>DEBUG : [REDACTED]: config out: out=&{State:*oauth-confirm,choose_type,, Option:<nil> OAuth:<nil> Error: Result:}, err=<nil>
<7>DEBUG : [REDACTED]: config in: state="*oauth-confirm,choose_type,,", result=""
<7>DEBUG : [REDACTED]: config out: out=&{State:*oauth-islocal,choose_type,, Option:true OAuth:<nil> Error: Result:}, err=<nil>
<7>DEBUG : [REDACTED]: config: reading config parameter "config_is_local"
Use auto config?
 * Say Y if not sure
 * Say N if you are working on a remote or headless machine

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

<7>DEBUG : [REDACTED]: config in: state="*oauth-islocal,choose_type,,", result="false"
<7>DEBUG : [REDACTED]: config out: out=&{State:*oauth-remote,choose_type,, Option:<nil> OAuth:<nil> Error: Result:}, err=<nil>
<7>DEBUG : [REDACTED]: config in: state="*oauth-remote,choose_type,,", result=""
<7>DEBUG : sending client_id = "[REDACTED]"
<7>DEBUG : sending client_secret = "[REDACTED]"
<7>DEBUG : [REDACTED]: config out: out=&{State:*oauth-authorize,choose_type,, Option: OAuth:<nil> Error: Result:}, err=<nil>
<7>DEBUG : [REDACTED]: config: reading config parameter "config_token"
Option config_token.
For this to work, you will need rclone available on a machine that has
a web browser available.
For more help and alternate methods see: https://rclone.org/remote_setup/
Execute the following on the machine with the web browser (same rclone
version recommended):
        rclone authorize "onedrive" "eyJjbGllbn..."
Then paste the result.
Enter a value.
config_token> eyJ0b2tlbi...

<7>DEBUG : [REDACTED]: config in: state="*oauth-authorize,choose_type,,", result="eyJ0b2tlbi..."
<7>DEBUG : [REDACTED]: config out: out=&{State:*oauth-authorize,choose_type,, Option:<nil> OAuth:<nil> Error:Couldn't decode response - try again (make sure you are using a matching version of rclone on both sides: invalid character 'e' looking for beginning of value
 Result:}, err=<nil>
Couldn't decode response - try again (make sure you are using a matching version of rclone on both sides: invalid character 'e' looking for beginning of value


<7>DEBUG : [REDACTED]: config in: state="*oauth-authorize,choose_type,,", result=""
<7>DEBUG : [REDACTED]: config out: out=&{State:*oauth-done,choose_type,, Option:<nil> OAuth:<nil> Error: Result:}, err=<nil>
<7>DEBUG : [REDACTED]: config in: state="*oauth-done,choose_type,,", result=""
<7>DEBUG : [REDACTED]: config out: out=&{State:choose_type Option:<nil> OAuth:<nil> Error: Result:}, err=<nil>
<7>DEBUG : [REDACTED]: config in: state="choose_type", result=""
<7>DEBUG : [REDACTED]: config out: out=<nil>, err=failed to configure OneDrive: empty token found - please run "rclone config reconnect [REDACTED]:"
Error: failed to configure OneDrive: empty token found - please run "rclone config reconnect [REDACTED]:"
Usage:
  rclone config reconnect remote: [flags]

Flags:
  -h, --help   help for reconnect

Use "rclone [command] --help" for more information about a command.
Use "rclone help flags" for to see the global flags.
Use "rclone help backends" for a list of supported services.

Fatal error: failed to configure OneDrive: empty token found - please run "rclone config reconnect [REDACTED]:"

Check out:

onedrive headless token input/buffer/length issue rclone 1.57 and 1.55 · Issue #5835 · rclone/rclone (github.com)

Oh, I see! So it's a matter of length no matter whether the rclone authorize side and the rclone config (reconnect) side have the same version.

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