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), selectWebinRedirect URI, then typehttp://localhost:53682/and click Register. Copy and keep theApplication (client) IDunder the app name for later use. - Under
manageselectCertificates & secrets, clickNew client secret. Copy and keep that secret value for later use (secret value, not secret ID). - Under
manageselectAPI permissions, clickAdd a permissionand selectMicrosoft Graphthen selectdelegated permissions. - Search and select the following permissions:
Files.ReadWrite.All. Once selected clickAdd permissionsat the bottom. - Download this script on your Windows computer, click
run in powershellin the right-click menu, enter yourclient idandclient 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.txtis 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.