如何自动续期 Office 365 E5 开发者订阅?


在本篇文章中将讲述如何自动续期 Office 365 E5 开发者订阅。


  1. 打开并登录 Azure Active Directory 管理中心
    截图1
  2. 点击上方 “新注册” 按钮
    截图2
  3. 按图示操作后,点击 “注册” 按钮
    截图3
    重定向 URL: http://localhost:53682/
  4. 点击右侧 “证书和密码” 按钮,并按图示操作
    截图4
    记录当前客户端密码
    截图5
  5. 点击右侧 “API 权限” 按钮,并按图示操作
    截图6
    截图7
    截图8
    按图示搜索并勾选以下权限
                                
    Calendars.Read
    Contacts.Read
    Directory.Read.All
    Files.Read.All
    Group.Read.All
    Mail.Read
    Notes.Read.All
    People.Read.All
    Sites.Read.All
    User.Read.All
                                
                            
    按图示点击 “授予管理员同意”
    截图9
  6. 下载并解压 rclone
    截图10
  7. 在终端中执行以下命令,并跟随网页提示进行操作:
                                
    rclone authorize "onedrive" "客户端 ID" "客户端密码"
                                
                            
    当验证通过后将会返回以下类似值:
                                
    {
        "access_token":"eyJ0eXAiOiJKV1QiLCJue25jZSI6IkZtTTdnMTdOU05SUUthOUJGYU1CUEZYc3E3R0NfdXVnbW5Dd0RyVTkyLVUiLCJhbGciOiJSfzI1NiIsIng1dCI6IkN0VHVoTUptRDVNN0RMZHpEMnYyeDNRS1NSWSIsImtpZCI6IkN0VHVoTUptRDVNN0RMZHpEMnYyeDNRS1NSWSJ9.eyJhdWQiOiIwMDAwMDAwMy0wMDAwLTAwMDAtYzAwMC0wMDAwMDAwMDAwMDAiLCJpc3MiOiJodHRwczovL3N0cy53aW5kb3dzLm5ldC8yZWEzYWJiYi1mNzZkLTRkNTMtYmFmMi1iYjhkYTY1MDZiZmMvIiwiaWF0IjoxNTkwNTUzOTA1LCJuYmYiOjE1OTA1NTM5MDUsImV4cCI6MTU5MDU1NzgwNSwiYWNjdCI6MCwiYWNyIjoiMSIsamFpbyI6IkFTUUEyLzhQQUFBQUh4ajRVMFc2c1RRdkFPQ1VlZWt0QjcvbUVvTEhrKzhWVXR1eUxBNzR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eWl5jUMxIVUONPgA-qBJZgG9LrkBrll3xMo_zJ-GKsALF26Te5duc5vYbPGLXSfKv-Jp8NTRucgxruE8ECldgH3Ks0AARUg9hHU2FuP6tLpPJqio-iqI_WnbusDf-4sAs-y7ua-egjIGtyQkgb84pXX585UR3fgh0-Czd68T3R4Y3xlqmXdw9bixjgGIAA",
        "expiry":"2020-05-27T13:36:45.134054175+08:00"
    }
                                
                            
    复制 "refresh_token" 键内的全部内容,并保存至 “refresh_token.txt”
  8. 修改 “run.py” 内 “client_id” 及 “client_secret” 的值
    截图11
  9. 执行以下命令后,会返回以下类似值
    python run.py
                                
    {
        "round_ID": 1,
        "calendars_read": true,
        "contacts_read": true,
        "directory_read_all": true,
        "files_read_all": true,
        "group_read_all": true,
        "mail_read": true,
        "notes_read_all": true,
        "people_read_all": true,
        "sites_read_all": true,
        "user_read_all": true
    }