The onedrive backend (backend-onedrive) targets Microsoft Graph API v1.0 cleanly across personal Microsoft accounts, OneDrive for Business, and SharePoint Document Libraries (--drive-id), using Entra ID OAuth 2.0 Desktop PKCE loopback.
Setup Recipes#
# Requests Files.ReadWrite.All offline_access User.Read via loopback PKCE
rship auth onedrive od \
--client-id "<AZURE_APPLICATION_CLIENT_ID>"
rship about od:Flags Reference (rship auth onedrive)#
| Flag | Default | Description |
|---|---|---|
<REMOTE> | — | Logical remote name (e.g. onedrive, sp-docs) |
--client-id | Interactive prompt | Azure App Registration (Entra ID) Application client_id |
--client-secret | None | Optional client secret (omit for public Mobile/Desktop PKCE app registrations) |
--drive-id | /me/drive | Explicit Microsoft Graph drive_id for SharePoint libraries |
--scope | Files.ReadWrite.All offline_access User.Read | Custom Graph OAuth scope string |
--access-token | None | Direct Graph bearer token for non-interactive automation |
Protocol Internals#
- Strict 320 KiB upload-session geometry: Files
<= 4 MiBupload directly; larger files create Graph upload sessions streaming10 MiB(32 × 320 KiB) aligned fragments (Graph hard ceiling60 MiBper request). nextExpectedRangescrash-resume: Queries active upload session URLs directly via Graph and resumes precisely at the server's reportednextExpectedRangesbyte offset.- Async server-side copy: Same-drive copies dispatch Microsoft Graph's async copy endpoint and poll the monitor URL until committed.
- rclone migration: Existing OneDrive remotes (
token,drive_id,drive_type,client_id,client_secret) import withrship config import-rclone.