It looks like onedrive sharepoint webdav is (going to be?) deprecated. I tried to edit "Permission Level" in "Site permission" and find this line “Use Remote Interfaces - Use SOAP, Web DAV, the Client Object Model or SharePoint Designer interfaces to access the Web site. (Deprecated)“.
A workaround now is to use cookies as suggested in this topic Sharepoint synchronization - #8 by codeye , and wait for the update from either microsoft (maybe not) or rclone (maybe yes):
[NAME_OF_YOUR_REMOTE]
type = webdav
url = YOUR_SHAREPOINT_URL
vendor = other
user = XXX
pass = XXX
headers = Cookie,rtFa=xxx;FedAuth=xxx
To make the cookies workaround automatic, you could use playwright to headless login and get cookies daily.
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Sep 17 00:25:09 2025
# For cron jobs:
python3 get_cookis.py rclone_remote_name usr pwd https://<YOURS>.sharepoint.com/<YOURS>/
@author: ttllttttlltt
"""
from playwright.sync_api import sync_playwright
import sys
import time
import configparser
account_name = sys.argv[1]
EMAIL = sys.argv[2]
PASSWORD = sys.argv[3]
SHAREPOINT_URL = sys.argv[4]
rcloneconf = '<PATH_TO_YOUR_rclone.conf>/rclone.conf'
# print('account_name',account_name)
# print('Email:',EMAIL)
# print('pwd:',PASSWORD)
# SHAREPOINT_URL = "https://<YOURS>.sharepoint.com/<YOURS>/"
with sync_playwright() as p:
browser = p.chromium.launch(headless=True) # start with headless=False for debugging
context = browser.new_context()
page = context.new_page()
page.goto(SHAREPOINT_URL)
# Step 1: Enter email/username
page.wait_for_selector('input[name="loginfmt"]')
page.fill('input[name="loginfmt"]', EMAIL)
page.click('input[type="submit"]')
# Step 2: Enter password
page.wait_for_selector('input[name="passwd"]')
page.fill('input[name="passwd"]', PASSWORD)
page.click('input[type="submit"]')
try:
page.wait_for_selector('input[id="idBtn_Back"]', timeout=5000)
page.click('input[id="idBtn_Back"]')
except:
pass
# Wait until SharePoint page is fully loaded
# page.wait_for_load_state("networkidle")
# page.wait_for_selector("div[data-automationid='SiteHeader']", timeout=10000)
time.sleep(15)
# Get cookies
cookies = context.cookies()
# cookie_header = "; ".join([f"{c['name']}={c['value']}" for c in cookies])
# rtFa = cookies.get('rtFa')
for i in cookies:
if i['name']=='rtFa':
rtfastr = i['value']
# print("rtFa:\n", rtfastr)
if i['name']=='FedAuth':
fedauthstr = i['value']
# print("FedAuth:\n", fedauthstr)
# Save session for reuse
context.storage_state(path="sharepoint_state.json")
config = configparser.ConfigParser()
config.sections()
config.read(rcloneconf)
config[account_name]['headers']='Cookie,rtFa='+rtfastr+';FedAuth='+fedauthstr
with open(rcloneconf, 'w') as configfile:
config.write(configfile)
browser.close()