首页 > 其他分享 >rclone OneDrive 长期token

rclone OneDrive 长期token

时间:2022-12-19 11:45:27浏览次数:98  
标签:rclone OneDrive token click select permissions

OneDrive

搜到的文档总有缺失,而且都是1h的access token,过期就得重复一遍初始化token的手动流程

翻了翻官方文档,是有办法申请长期有效的token的,就是步骤麻烦一些

步骤

  1. Open https://portal.azure.com/#blade/Microsoft_AAD_RegisteredApps/ApplicationsListBlade and then click New registration.
  2. 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), select Web in Redirect URI, then type (do not copy and paste) http://localhost:53682/ and click Register. Copy and keep the Application (client) ID under the app name for later use.
  3. Under manage select Certificates & secrets, click New client secret. Enter a description (can be anything) and set Expires to 24 months. Copy and keep that secret Value for later use (you won't be able to see this value afterwards).
  4. Under manage select API permissions, click Add a permission and select Microsoft Graph then select delegated permissions.
  5. Search and select the following permissions: Files.ReadFiles.ReadWriteFiles.Read.AllFiles.ReadWrite.Alloffline_accessUser.Read and Sites.Read.All (if custom access scopes are configured, select the permissions accordingly). Once selected click Add 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,不用担心

 

引用

标签:rclone,OneDrive,token,click,select,permissions
From: https://www.cnblogs.com/SiriusA/p/16991771.html

相关文章