我有一个Ubuntu服务器,我想要迁移到Google Drive,大约有5TB的数据 . 我正在使用rclone来做到这一点 . 我在Googles开发者控制台中创建了一个应用程序 . 当经历rclone配置过程时,我陷入困境 . 这是一个无头机器,所以我不能使用打开127.0.0.1的自动配置 . 所以我选择“不”,它要求我访问如下所示的URL:

https://accounts.google.com/o/oauth2/auth?access_type=offline&client_id=XXXXXXXXXXXXXXXXXXXXX&redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=code&scope=https://www.googleapis.com/auth/drive&state=XXXXXXXXXXXXXXXXXXXXXXXX

这里的问题是redirect_uri参数: urn:ietf:wg:oauth:2.0:oob . 这仅适用于本机移动应用程序 . 我为网络应用设置了OAuth 2.0客户端,以使用公开可访问的重定向网址:

oAuth web client app configuration

但即使在保存之后,再次运行rclone配置会给我一个具有相同redirect_uri值( urn:ietf:wg:oauth:2.0:oob )的URL,而不是我刚设置的新URL . 如果我手动尝试将URL更改为https://example.com,我可以登录并授权驱动器用户 . 像这样:

https://accounts.google.com/o/oauth2/auth?access_type=offline&client_id=XXXXXXXXXXXXXXXXXXXXX&redirect_uri= https://example.com &response_type = code&scope = https://www.googleapis.com/auth/drive&state=XXXXXXXXXXXXXXXXXXXXXXXX

复制并粘贴从该重定向返回的代码在rclone中给出了一个错误,因为它与rclone给我的重定向URI不匹配 . 重定向URI看起来像这样:

https://example.com/?state=b91f685ac1161ed6XXXXXXXXXXXXc0&code=4/bQwymvciXXXXXXXXXXXXXXXXXXXXXXXXXXx#

然后在rclone中输入验证码:

Log in and authorize rclone for access
Enter verification code> 4/bQwymvciXXXXXXXXXXXXXXXXXXXXXXXXXXx#
2018/01/29 14:25:53 Failed to configure token: failed to get token: oauth2: 
cannot fetch token: 400 Bad Request
Response: {
  "error" : "redirect_uri_mismatch"
}

由于此错误,未保存配置 . 如何授予Google Cloud 端硬盘用户访问我的应用的权限?

End result is I want another user to have full access to the drive my app creates.

ADDED NOTE: 我认为我可以通过驱动器GUI与其他用户共享服务帐户驱动器,这是我正在尝试做的全部事情 .