Getting 401 error

What is the problem you are having with rclone?

I am getting an error 401, like so:

Failed to query available drives: HTTP error 401 (401 Unauthorized) returned body: "{\"error\":{\"code\":\"InvalidAuthenticationToken\",\"message\":\"InvalidCloudInstance\",\"innerError\":{\"date\":\"2025-07-01T19:00:19\",\"request-id\":\"7407ee20-fddf-42b6-888f-b5b17ff3526a\",\"client-request-id\":\"7407ee20-fddf-42b6-888f-b5b17ff3526a\"}}}"

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

rclone v1.70.2
- os/version: ubuntu 24.04 (64 bit)
- os/kernel: 6.8.0-62-generic (x86_64)
- os/type: linux
- os/arch: amd64
- go/version: go1.24.4
- go/linking: static
- go/tags: none

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

Microsoft OneDrive (business)

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

I am using rclone config to create the first entry and configuration. Nothing else for now.

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

[onedrive]
type = onedrive
region = us
auth_url = https://login.microsoftonline.com/tenant-ID_goes_here/oauth2/v2.0/authorize
token_url = https://login.microsoftonline.com/tenant-ID_goes_here/oauth2/v2.0/token
drive_id = XXX
drive_type = business
access_scopes = Files.Read Files.ReadWrite Files.Read.All Files.ReadWrite.All offline_access
link_scope = organization
link_type = edit
token = XXX
### Double check the config for sensitive info before posting publicly

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

I haven't been able to finish the config. Please let me know if there is anything I might need to provide for a successful connection.

On my organisation Entra Centre, I have the tenant ID, and a Primary Domain. Should I be using that primary domain on the auth_url and token_url instead? The authentication returns success on the browser, but just wondering.

I tried the primary domain on my Entra Centre. That didn't work. Any tips that might lead me to successfully configure rclone with OneDrive business appreciated.

Found the mistake, and I am able to connect fine now. I was overthinking it. I was picking the Government cloud, but that was the wrong choice. Picking "global" instead worked. Looks like the level of government I work for doesn't use "the" Government cloud. :man_facepalming:

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