If you want to use your private client_id and client_secret to setup this app, you can follow the steps below.
- Open https://portal.azure.com/#blade/Microsoft_AAD_RegisteredApps/ApplicationsListBlade and then click
New registration
. - Enter a name for your app, choose account type
Accounts in any organizational directory (Any Azure AD directory - Multitenant) and personal Microsoft accounts (e.g. Skype, Xbox)
, selectWeb
inRedirect URI
, then typehttp://localhost:53682/
and click Register. Copy and keep theApplication (client) ID
under the app name for later use. - Under
manage
selectCertificates & secrets
, clickNew client secret
. Copy and keep that secret value for later use (secret value, not secret ID). - Under
manage
selectAPI permissions
, clickAdd a permission
and selectMicrosoft Graph
then selectdelegated permissions
. - Search and select the following permissions:
Files.ReadWrite.All
. Once selected clickAdd permissions
at the bottom. - Download this script on your Windows computer, click
run in powershell
in the right-click menu, enter yourclient id
andclient secret
, and follow the instruction to getrefresh_token
. (if the script is forbidden, execute in powershell as administratorStart-Process -Wait -Verb RunAs powershell.exe -Args "-executionpolicy bypass -command Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force
) - When finished,
token.txt
is saved on your desktop.
open config.toml
and fill in the following fields:
ClientID: client id
ClientSecret: client secret
AccountArea: the area of your onedrive account, can be ("global" | "gov" | "de" | "cn")
Drive: the drive path to use. default: "/me/drive"
open token.txt
and copy the refresh token to the file.