You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adds support for Microsoft’s OAuth2 Device Authorisation Flow, enabling the client to authenticate using device and user codes on a second device. This is particularly useful for headless or limited-input environments where interactive browser login is not possible.
Includes:
- Initiating device code requests and displaying user instructions
- Polling token endpoint until user authorises the device or the code expires
- Error handling for pending, declined, and expired authorisation states
- Countdown display showing remaining authorisation window
This feature is enabled via the `use_device_auth` config option
> To ensure that data deleted locally remains accessible online, you can use the 'no_remote_delete' option. If you want to delete the data from your local storage after a successful upload to Microsoft OneDrive, you can use the 'remove_source_files' option.
1020
1021
1022
+
### use_device_auth
1023
+
_**Description:**_ Enable this option to authenticate using the Microsoft OAuth2 Device Authorisation Flow (`device_code` grant). This flow allows the client to initiate a sign-in process without launching a web browser directly — ideal for headless systems or remote sessions. A short code and URL will be provided for the user to complete authentication via a separate browser-enabled device.
1024
+
1025
+
_**Value Type:**_ Boolean
1026
+
1027
+
_**Default Value:**_ False
1028
+
1029
+
_**Config Example:**_`use_device_auth = "false"` or `use_device_auth = "true"`
1030
+
1031
+
_**CLI Option Use:**_*None - this is a config file option only*
1032
+
1033
+
> [!IMPORTANT]
1034
+
> This option is fully supported for Microsoft Entra ID (Work/School) accounts. For personal Microsoft accounts (e.g., @outlook.com or @hotmail.com), this method of authentication is not supported. Please use the interactive interactive authentication method (default) to authenticate this application.
1035
+
1021
1036
### use_intune_sso
1022
1037
_**Description:**_ Enable this option to authenticate using Intune Single Sign-On (SSO) via the Microsoft Identity Device Broker over D-Bus. This method is suitable for environments where the system is Intune-enrolled and allows seamless token retrieval without requiring browser interaction.
Copy file name to clipboardExpand all lines: docs/usage.md
+51-1Lines changed: 51 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -336,6 +336,7 @@ If you explicitly want to use HTTP/1.1, you can do so by using the `--force-http
336
336
> If you continue to use a curl/libcurl version with known HTTP/2 bugs you will experience application runtime issues such as randomly exiting for zero reason or incomplete download/upload of your data.
337
337
338
338
## First Steps
339
+
339
340
### Authorise the Application with Your Microsoft OneDrive Account
340
341
Once you've installed the application, you'll need to authorise it using your Microsoft OneDrive Account. This can be done by simply running the application without any additional command switches.
341
342
@@ -344,6 +345,7 @@ Please be aware that some companies may require you to explicitly add this app t
344
345
This client supports the following methods to authenticate the application with Microsoft OneDrive:
345
346
* Supports interactive browser-based authentication using OAuth2 and a response URI
346
347
* Supports seamless Single Sign-On (SSO) via Intune using the Microsoft Identity Device Broker D-Bus interface
348
+
* Supports OAuth2 Device Authorisation Flow for Microsoft Entra ID accounts
347
349
348
350
#### Interactive Authentication using OAuth2 and a response URI
349
351
When you run the application for the first time, you'll be prompted to open a specific URL using your web browser, where you'll need to log in to your Microsoft Account and grant the application permission to access your files. After granting permission to the application, you'll be redirected to a blank page. Simply copy the URI from the blank page and paste it into the application.
@@ -380,6 +382,54 @@ Intune SSO via Microsoft Identity Broker dbus session usage criteria met - will
380
382
> [!NOTE]
381
383
> The installation and configuration of Intune for your platform is beyond the scope of this documentation.
382
384
385
+
#### OAuth2 Device Authorisation Flow for Microsoft Entra ID accounts
386
+
To use this method of authentication, you must add the following configuration to your 'config' file:
387
+
```
388
+
use_device_auth = "true"
389
+
```
390
+
You will be required to open a URL using a web browser, and enter the code that this application presents:
391
+
```
392
+
Configuring Global Azure AD Endpoints
393
+
394
+
Authorise this application by visiting:
395
+
396
+
https://microsoft.com/devicelogin
397
+
398
+
Enter the following code when prompted: ABCDEFGHI
399
+
400
+
This code expires at: 2025-Jun-02 15:27:30
401
+
```
402
+
You will have ~15 minutes before the code expires.
403
+
404
+
> [!IMPORTANT]
405
+
> #### Limitation: OAuth2 Device Authorization Flow and Personal Microsoft Accounts
406
+
>
407
+
> While the OneDrive Client for Linux fully supports OAuth2 Device Authorisation Flow (`device_code` grant) for **Microsoft Entra ID (Work/School)** accounts, **Microsoft currently does not allow this flow to be used with personal Microsoft accounts (MSA)** unless the application is explicitly authorised by Microsoft.
> This behaviour confirms that Microsoft **blocks the `device_code` grant flow for MSA accounts** on unapproved apps.
427
+
>
428
+
> **Recommendation:**
429
+
> If using a personal Microsoft account (e.g., @outlook.com or @hotmail.com), please complete authentication using the interactive authentication method detailed above.
#### OneDrive service running as a non-root user via systemd (All Linux Distributions)
1260
1310
In some instances, it is preferable to run the OneDrive client as a service without the 'root' user. Follow the instructions below to configure the service for your regular user login.
1261
1311
1262
-
1. As the user who will run the service, launch the application in standalone mode, authorize it for use, and verify that synchronization is functioning as expected:
1312
+
1. As the user who will run the service, launch the application in standalone mode, authorise it for use, and verify that synchronisation is functioning as expected:
Copy file name to clipboardExpand all lines: readme.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,6 +25,7 @@ Since forking in early 2018, this client has evolved into a clean re-imagining o
25
25
* Supports seamless access to shared folders and files across both OneDrive Personal and OneDrive for Business accounts
26
26
* Supports single-tenant and multi-tenant applications
27
27
* Supports Intune Single Sign-On (SSO) authentication via the Microsoft Identity Device Broker (D-Bus interface)
28
+
* Supports OAuth2 Device Authorisation Flow for Microsoft Entra ID accounts
28
29
* Supports national cloud deployments including Microsoft Cloud for US Government, Microsoft Cloud Germany, and Azure/Office 365 operated by VNET in China
29
30
* Provides rules for client-side filtering to select data for syncing with Microsoft OneDrive accounts
30
31
* Protects against significant data loss on OneDrive after configuration changes
0 commit comments