Updated: 2026-01-14
Update Note: Confirmed that app registration for consumer and work accounts yield same.
We need to do some prep setup in order to
be able to call the Microsoft Graph REST APIs;
use Microsoft's MSAL for Python to handle auth flow.
We need to register an app via Entra ID, and when we first log in, need to give permissions.
Note set up an App Registration for a consumer account and a work account - the steps below work for both account types.
Log into your Microsoft account
Go to https://portal.azure.com
Navigate to Entra ID
Select App Registration
Create New App registration
Since we are using personal accounts, select "Personal Microsoft accounts only" (left)
The new registration should look like the left
Go to "Settings"
Make sure "Allow public client flows" is enabled
Save
Take a copy of the Client ID and update the client id in the config file (see onedrive.py)
When running for the first time, will be asked to authenticate
To sign in, use a web browser to open the page https://www.microsoft.com/link and enter the code XXXX to authenticate.
To avoid issues with caching, open a new incognito browser session, paste the URL, and follow the prompts to log in
As part of the first run process, request will be made based on scope
Accept
Note: This is safe as you created the app registration and you're logging in as you.
Note: This is a Google Site. Feedback here.