RCLONE without username and password for MS Sharepoint remote

STOP and READ USE THIS TEMPLATE NO EXCEPTIONS - By not using this, you waste your time, our time and really hate puppies. Please remove these two lines and that will confirm you have read them.

What is the problem you are having with rclone?

Which information do i need to configure rclone with MS Sharepoint remote without the need to provide a username and password?

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

[matte@localhost rclone]$ rclone version
rclone v1.64.0

  • os/version: oracle 7.9 (64 bit)
  • os/kernel: 5.4.17-2136.322.6.2.el7uek.x86_64 (x86_64)
  • os/type: linux
  • os/arch: amd64
  • go/version: go1.21.1
  • go/linking: static
  • go/tags: none

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

Onedrive - Sharepoint

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.

[matte@localhost rclone]$ rclone config redacted
[NETCO_3]
type = onedrive
client_id = XXX
client_secret = XXX
token = XXX
auth_url = Sign in to your account
token_url = Sign in to your account
drive_id = XXX
drive_type = documentLibrary

[NETCO_4]
type = onedrive
client_id = XXX
client_secret = XXX
token = XXX

[NETCO_7]
type = onedrive
client_id = XXX
client_secret = XXX

[NETCO_9]
type = onedrive
client_id = XXX
client_secret = XXX
token = XXX
drive_id = XXX
drive_type = documentLibrary

[OPCO_1]
type = onedrive
client_id = XXX
client_secret = XXX
token = XXX
drive_id = XXX
drive_type = documentLibrary

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

2023/09/21 09:32:06 Failed to create file system for "NETCO_3:General": failed to get root: InvalidAuthenticationToken: CompactToken parsing failed with error code: 80049217

You do not need username and password. You need authentication token - if you can get it by other means then simply copy paste it into your config.

How should i provide it?

Open rclone.config in your favourite text editor and copy/paste token (replace XXX with you token)

[onedrive]
type = onedrive
drive_id = 12345
drive_type = personal
token = XXX

token look like:

{"access_token":"","token_type":"Bearer","refresh_token":"","expiry":"2023-09-16T11:42:09.087811+01:00"}

I have successfuly obtained the token and Rclone mounted the sharepoint folder. Suddendly after 1 hour the connection break due to token expire.
How should i generate a refresh token in order to keep always the folder mounted?
I seen that with a username the refresh token is generate automatically while with managed identity no.
Any help really appreciated.
BR

Use rclone config to setup your remote. It will generate the right token for you.

i have tried unsuccessfully, rclone requires authorization by the browser with a personal account. I want to avoid this behavior.
May you please provide me an example on how to fill rclone config's parameter to use the token and get back also a refresh_token?

IMO you need authorization. I am no sure why you want to avoid it.

Rclone prints a URL when it opens the browser for auth.

You can copy and paste this into an incognito window if you need different auth than you have in your main browser window.

What i'm looking for is to grant access to rclone without an account.
What sysadmin told me is that we are providing to rclone all the information to access the azure app: client-id and secret; so he can't understand why it needs also an account.

Does rclone act as an app rather than a user?

I think you may be talking about this issue?

correct, if i well understand isn't yet solved?

Did you click on the link?

yes, what i have understood is that client credential works for Azure Blob but not for Onedrive-shareporint. do i misunderstood?

Azure Blob and Onedrive/Sharepoint are two completely different back ends so not sure the connection.

The issue you've posted is about Sharepoint and the issue @ncw linked is the one about adding support for your ask.

It's still open so not solved/fixed.

If I am to understand this thread correctly, RClone does not currently support authentication to Sharepoint/Onedrive using a ClientID/Secret? At least until onedrive backend - support client credentials grant · Issue #6197 · rclone/rclone (github.com) is resolved? I have a similar task only I need to use the credentials provided from an app principal as outlined here: Granting access using SharePoint App-Only | Microsoft Learn

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