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)
, selectWeb
inRedirect URI
, then type (do not copy and paste)http://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
. Enter a description (can be anything) and setExpires
to 24 months. Copy and keep that secret Value for later use (you won't be able to see this value afterwards).- Under
manage
selectAPI permissions
, clickAdd a permission
and selectMicrosoft Graph
then selectdelegated permissions
.- Search and select the following permissions:
Files.Read
,Files.ReadWrite
,Files.Read.All
,Files.ReadWrite.All
,offline_access
,User.Read
andSites.Read.All
(if custom access scopes are configured, select the permissions accordingly). Once selected clickAdd permissions
at the bottom.Now the application is complete. Run
rclone config
to 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,不用担心