What is the problem you are having with rclone?
Hello,
I'm trying to complete OneDrive config using custom client ID. It successfully redirects to the browser and I see
Success!
All done. Please go back to rclone.
But the command output says
2022/08/03 17:06:55 Fatal error: failed to get token: invalid character '<' looking for beginning of value
I reran with rclone config -vv --dump responses --log-file /tmp/rclone.log
and see a REQUEST URL that contains a scope
http parameter
https://login.microsoftonline.com/da6.../oauth2/v2.0/authorize?access_type=offline&client_id=ec14...&redirect_uri=http%3A%2F%2Flocalhost%3A53682%2F&response_type=code&scope=Files.Read+Files.ReadWrite+Files.Read.All+Files.ReadWrite.All+Sites.Read.All+offline_access&state=YLzwO9gv4r1LtI3xsMeCig
But burried in the JSON response I see it claiming that scope
should be part of the BODY.
$Config={
"iErrorDesc": 0,
"iErrorTitle": 0,
"strMainMessage": "We received a bad request.",
"strAdditionalMessage": "",
"strServiceExceptionMessage": "AADSTS900144: The request body must contain the following parameter: \u0026#39;scope\u0026#39;.",
"strTraceId": "ce627b70-6e47-4bdc-84ec-dc911249d700",
"iErrorCode": 900144,
"iHttpErrorCode": 400,
...
I found a possibly related post here: http - oauth2 error AADSTS90014: The request body must contain the following parameter: 'grant_type' - Stack Overflow where one respondent says
You shouldn't send
grant_type
neither in params nor in headers. Those should be sent in body params then only it will work.
Not sure if that's the real root cause, but looking for help (obviously). Thanks in advance.
Run the command 'rclone version' and share the full output of the command.
rclone v1.59.0
- os/version: darwin 12.3.1 (64 bit)
- os/kernel: 21.4.0 (x86_64)
- os/type: darwin
- os/arch: amd64
- go/version: go1.18.3
- go/linking: dynamic
- go/tags: cmount
Which cloud storage system are you using? (eg Google Drive)
onedrive
The command you were trying to run (eg rclone copy /tmp remote:tmp
)
rclone config
The rclone config contents with secrets removed.
[onedrive-kmarx]
type = onedrive
client_id = ec1...
client_secret = e2f...
# Manually added to try and work around "Error: Auth Error; No code returned by remote server"
# per https://rclone.org/onedrive/
auth_url = https://login.microsoftonline.com/da6.../oauth2/v2.0/authorize
token_url = https://login.microsoftonline.com/da6.../oauth2/v2.0/authorize
A log from the command with the -vv
flag
2022/08/03 16:23:48 DEBUG : rclone: Version "v1.59.0" starting with parameters ["rclone" "config" "-vv" "--log-file" "/tmp/rclone.log"]
2022/08/03 16:23:48 DEBUG : Using config file from "/Users/kmarx/.config/rclone/rclone.conf"
2022/08/03 16:23:55 DEBUG : onedrive-kmarx: config in: state="*all", result=""
2022/08/03 16:23:55 DEBUG : onedrive-kmarx: config out: out=&{State:*all-set,0,false Option:ec1... OAuth:<nil> Error: Result:}, err=<nil>
2022/08/03 16:23:55 DEBUG : onedrive-kmarx: config: reading config parameter "client_id"
2022/08/03 16:23:56 DEBUG : onedrive-kmarx: config in: state="*all-set,0,false", result="ec1..."
2022/08/03 16:23:56 DEBUG : onedrive-kmarx: config out: out=&{State:*all,1,false Option:<nil> OAuth:<nil> Error: Result:}, err=<nil>
2022/08/03 16:23:56 DEBUG : onedrive-kmarx: config in: state="*all,1,false", result=""
2022/08/03 16:23:56 DEBUG : onedrive-kmarx: config out: out=&{State:*all-set,1,false Option:e2f... OAuth:<nil> Error: Result:}, err=<nil>
2022/08/03 16:23:56 DEBUG : onedrive-kmarx: config: reading config parameter "client_secret"
2022/08/03 16:23:57 DEBUG : onedrive-kmarx: config in: state="*all-set,1,false", result="e2f..."
2022/08/03 16:23:57 DEBUG : onedrive-kmarx: config out: out=&{State:*all,2,false Option:<nil> OAuth:<nil> Error: Result:}, err=<nil>
2022/08/03 16:23:57 DEBUG : onedrive-kmarx: config in: state="*all,2,false", result=""
2022/08/03 16:23:57 DEBUG : onedrive-kmarx: config out: out=&{State:*all,3,false Option:<nil> OAuth:<nil> Error: Result:}, err=<nil>
2022/08/03 16:23:57 DEBUG : onedrive-kmarx: config in: state="*all,3,false", result=""
2022/08/03 16:23:57 DEBUG : onedrive-kmarx: config out: out=&{State:*all,4,false Option:<nil> OAuth:<nil> Error: Result:}, err=<nil>
2022/08/03 16:23:57 DEBUG : onedrive-kmarx: config in: state="*all,4,false", result=""
2022/08/03 16:23:57 DEBUG : onedrive-kmarx: config out: out=&{State:*all,5,false Option:<nil> OAuth:<nil> Error: Result:}, err=<nil>
2022/08/03 16:23:57 DEBUG : onedrive-kmarx: config in: state="*all,5,false", result=""
2022/08/03 16:23:57 DEBUG : onedrive-kmarx: config out: out=&{State:*all-set,5,false Option:global OAuth:<nil> Error: Result:}, err=<nil>
2022/08/03 16:23:57 DEBUG : onedrive-kmarx: config: reading config parameter "region"
2022/08/03 16:23:58 DEBUG : onedrive-kmarx: config in: state="*all-set,5,false", result="global"
2022/08/03 16:23:58 DEBUG : onedrive-kmarx: config out: out=&{State:*all,6,false Option:<nil> OAuth:<nil> Error: Result:}, err=<nil>
2022/08/03 16:23:58 DEBUG : onedrive-kmarx: config in: state="*all,6,false", result=""
2022/08/03 16:23:58 DEBUG : onedrive-kmarx: config out: out=&{State:*all,7,false Option:<nil> OAuth:<nil> Error: Result:}, err=<nil>
2022/08/03 16:23:58 DEBUG : onedrive-kmarx: config in: state="*all,7,false", result=""
2022/08/03 16:23:58 DEBUG : onedrive-kmarx: config out: out=&{State:*all,8,false Option:<nil> OAuth:<nil> Error: Result:}, err=<nil>
2022/08/03 16:23:58 DEBUG : onedrive-kmarx: config in: state="*all,8,false", result=""
2022/08/03 16:23:58 DEBUG : onedrive-kmarx: config out: out=&{State:*all,9,false Option:<nil> OAuth:<nil> Error: Result:}, err=<nil>
2022/08/03 16:23:58 DEBUG : onedrive-kmarx: config in: state="*all,9,false", result=""
2022/08/03 16:23:58 DEBUG : onedrive-kmarx: config out: out=&{State:*all,10,false Option:<nil> OAuth:<nil> Error: Result:}, err=<nil>
2022/08/03 16:23:58 DEBUG : onedrive-kmarx: config in: state="*all,10,false", result=""
2022/08/03 16:23:58 DEBUG : onedrive-kmarx: config out: out=&{State:*all,11,false Option:<nil> OAuth:<nil> Error: Result:}, err=<nil>
2022/08/03 16:23:58 DEBUG : onedrive-kmarx: config in: state="*all,11,false", result=""
2022/08/03 16:23:58 DEBUG : onedrive-kmarx: config out: out=&{State:*all,12,false Option:<nil> OAuth:<nil> Error: Result:}, err=<nil>
2022/08/03 16:23:58 DEBUG : onedrive-kmarx: config in: state="*all,12,false", result=""
2022/08/03 16:23:58 DEBUG : onedrive-kmarx: config out: out=&{State:*all,13,false Option:<nil> OAuth:<nil> Error: Result:}, err=<nil>
2022/08/03 16:23:58 DEBUG : onedrive-kmarx: config in: state="*all,13,false", result=""
2022/08/03 16:23:58 DEBUG : onedrive-kmarx: config out: out=&{State:*all,14,false Option:<nil> OAuth:<nil> Error: Result:}, err=<nil>
2022/08/03 16:23:58 DEBUG : onedrive-kmarx: config in: state="*all,14,false", result=""
2022/08/03 16:23:58 DEBUG : onedrive-kmarx: config out: out=&{State:*all,15,false Option:<nil> OAuth:<nil> Error: Result:}, err=<nil>
2022/08/03 16:23:58 DEBUG : onedrive-kmarx: config in: state="*all,15,false", result=""
2022/08/03 16:23:58 DEBUG : onedrive-kmarx: config out: out=&{State:*all,16,false Option:<nil> OAuth:<nil> Error: Result:}, err=<nil>
2022/08/03 16:23:58 DEBUG : onedrive-kmarx: config in: state="*all,16,false", result=""
2022/08/03 16:23:58 DEBUG : onedrive-kmarx: config out: out=&{State:*all,17,false Option:<nil> OAuth:<nil> Error: Result:}, err=<nil>
2022/08/03 16:23:58 DEBUG : onedrive-kmarx: config in: state="*all,17,false", result=""
2022/08/03 16:23:58 DEBUG : onedrive-kmarx: config out: out=&{State:*all,18,false Option:<nil> OAuth:<nil> Error: Result:}, err=<nil>
2022/08/03 16:23:58 DEBUG : onedrive-kmarx: config in: state="*all,18,false", result=""
2022/08/03 16:23:58 DEBUG : onedrive-kmarx: config out: out=&{State:*all,19,false Option:<nil> OAuth:<nil> Error: Result:}, err=<nil>
2022/08/03 16:23:58 DEBUG : onedrive-kmarx: config in: state="*all,19,false", result=""
2022/08/03 16:23:58 DEBUG : onedrive-kmarx: config out: out=&{State:*all,20,false Option:<nil> OAuth:<nil> Error: Result:}, err=<nil>
2022/08/03 16:23:58 DEBUG : onedrive-kmarx: config in: state="*all,20,false", result=""
2022/08/03 16:23:58 DEBUG : onedrive-kmarx: config out: out=&{State:*all-advanced Option:false OAuth:<nil> Error: Result:}, err=<nil>
2022/08/03 16:23:58 DEBUG : onedrive-kmarx: config: reading config parameter "config_fs_advanced"
2022/08/03 16:24:03 DEBUG : onedrive-kmarx: config in: state="*all-advanced", result="false"
2022/08/03 16:24:03 DEBUG : onedrive-kmarx: config out: out=&{State:*postconfig Option:<nil> OAuth:<nil> Error: Result:}, err=<nil>
2022/08/03 16:24:03 DEBUG : onedrive-kmarx: config in: state="*postconfig", result=""
2022/08/03 16:24:03 DEBUG : onedrive-kmarx: config in: state="", result=""
2022/08/03 16:24:03 DEBUG : onedrive-kmarx: config out: out=&{State:*oauth,choose_type,, Option:<nil> OAuth:<nil> Error: Result:}, err=<nil>
2022/08/03 16:24:03 DEBUG : onedrive-kmarx: config out: out=&{State:*oauth,choose_type,, Option:<nil> OAuth:<nil> Error: Result:}, err=<nil>
2022/08/03 16:24:03 DEBUG : onedrive-kmarx: config in: state="*oauth,choose_type,,", result=""
2022/08/03 16:24:03 DEBUG : onedrive-kmarx: config out: out=&{State:*oauth-confirm,choose_type,, Option:<nil> OAuth:<nil> Error: Result:}, err=<nil>
2022/08/03 16:24:03 DEBUG : onedrive-kmarx: config in: state="*oauth-confirm,choose_type,,", result=""
2022/08/03 16:24:03 DEBUG : onedrive-kmarx: config out: out=&{State:*oauth-islocal,choose_type,, Option:true OAuth:<nil> Error: Result:}, err=<nil>
2022/08/03 16:24:03 DEBUG : onedrive-kmarx: config: reading config parameter "config_is_local"
2022/08/03 16:24:07 DEBUG : onedrive-kmarx: config in: state="*oauth-islocal,choose_type,,", result="true"
2022/08/03 16:24:07 DEBUG : onedrive-kmarx: config out: out=&{State:*oauth-do,choose_type,, Option:<nil> OAuth:<nil> Error: Result:}, err=<nil>
2022/08/03 16:24:07 DEBUG : onedrive-kmarx: config in: state="*oauth-do,choose_type,,", result=""
2022/08/03 16:24:07 NOTICE: Make sure your Redirect URL is set to "http://localhost:53682/" in your custom config.
2022/08/03 16:24:07 DEBUG : Starting auth server on 127.0.0.1:53682
2022/08/03 16:24:07 NOTICE: If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth?state=r8ceul7TUSg0QYmp-2hDYA
2022/08/03 16:24:07 NOTICE: Log in and authorize rclone for access
2022/08/03 16:24:07 NOTICE: Waiting for code...
2022/08/03 16:24:07 DEBUG : Redirecting browser to: https://login.microsoftonline.com/da6.../oauth2/v2.0/authorize?access_type=offline&client_id=ec1...&redirect_uri=http%3A%2F%2Flocalhost%3A53682%2F&response_type=code&scope=Files.Read+Files.ReadWrite+Files.Read.All+Files.ReadWrite.All+Sites.Read.All+offline_access&state=r8ceul7TUSg0QYmp-2hDYA
2022/08/03 16:24:08 DEBUG : Received GET request on auth server to "/"
2022/08/03 16:24:08 NOTICE: Got code
2022/08/03 16:24:08 DEBUG : Closing auth server
2022/08/03 16:24:08 DEBUG : Closed auth server with error: accept tcp 127.0.0.1:53682: use of closed network connection
2022/08/03 16:24:08 DEBUG : onedrive-kmarx: config out: out=<nil>, err=failed to get token: invalid character '<' looking for beginning of value
Error: failed to get token: invalid character '<' looking for beginning of value
Usage:
rclone config [flags]
rclone config [command]
Available Commands:
create Create a new remote with name, type and options.
delete Delete an existing remote.
disconnect Disconnects user from remote
dump Dump the config file as JSON.
file Show path of configuration file in use.
password Update password in an existing remote.
paths Show paths used for configuration, cache, temp etc.
providers List in JSON format all the providers and options.
reconnect Re-authenticates user with remote.
show Print (decrypted) config file, or the config for a single remote.
touch Ensure configuration file exists.
update Update options in an existing remote.
userinfo Prints info about logged in user of remote.
Flags:
-h, --help help for config
Additional help topics:
rclone config edit Enter an interactive configuration session.
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.
2022/08/03 16:24:08 Fatal error: failed to get token: invalid character '<' looking for beginning of value