rclone OneDrive 长期token
OneDrive
搜到的文档总有缺失,而且都是1h的access token,过期就得重复一遍初始化token的手动流程
翻了翻官方文档,是有办法申请长期有效的token的,就是步骤麻烦一些
步骤
- 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 type (do not copy and paste)http://localhost:53682/and click Register. Copy and keep theApplication (client) IDunder the app name for later use.- Under
manageselectCertificates & secrets, clickNew client secret. Enter a description (can be anything) and setExpiresto 24 months. Copy and keep that secret Value for later use (you won't be able to see this value afterwards).- Under
manageselectAPI permissions, clickAdd a permissionand selectMicrosoft Graphthen selectdelegated permissions.- Search and select the following permissions:
Files.Read,Files.ReadWrite,Files.Read.All,Files.ReadWrite.All,offline_access,User.ReadandSites.Read.All(if custom access scopes are configured, select the permissions accordingly). Once selected clickAdd permissionsat the bottom.Now the application is complete. Run
rclone configto create or edit a OneDrive remote. Supply the app ID and password as Client ID and Secret, respectively. rclone will walk you through the remaining steps.
需要注意的是,Client Secret里要填第3步中生成的Secret Value,不是填ID
在rclone生成token后,json中显示还是1h后过期,但是到期后会自动refresh token,不用担心

浙公网安备 33010602011771号