我需要什么范围和权限才能让某人从我的 Google 驱动器下载文件?
What scopes and permissions do I need to be able to get someone to download files from my Google Drive?
所以我提供了我的凭据以及 python 脚本,以允许从我的 Google 驱动器下载一些文件。我尝试使用这些范围,但它们都失败了:
- https://www.googleapis.com/auth/drive.file
- https://www.googleapis.com/auth/drive.activity.readonly
- https://www.googleapis.com/auth/drive.metadata.readonly
只有这个有效:
https://www.googleapis.com/auth/drive
但此令牌要求用户授予对 Google 驱动器的读取、写入、编辑和访问权限。为什么他们需要拥有所有这些权限,才能从另一个 Google 驱动器(即我的驱动器)下载文件?
我找不到此操作所需的最小范围。
我在 python 中使用 Google 驱动器 API。
从你的问题中,发现可以使用https://www.googleapis.com/auth/drive
。从这种情况来看,作为下载文件的scope,我觉得可以用下面的scope
https://www.googleapis.com/auth/drive.readonly
The official document 对这个范围的描述如下。
Allows read-only access to file metadata and file content.
所以我提供了我的凭据以及 python 脚本,以允许从我的 Google 驱动器下载一些文件。我尝试使用这些范围,但它们都失败了:
- https://www.googleapis.com/auth/drive.file
- https://www.googleapis.com/auth/drive.activity.readonly
- https://www.googleapis.com/auth/drive.metadata.readonly
只有这个有效: https://www.googleapis.com/auth/drive
但此令牌要求用户授予对 Google 驱动器的读取、写入、编辑和访问权限。为什么他们需要拥有所有这些权限,才能从另一个 Google 驱动器(即我的驱动器)下载文件?
我找不到此操作所需的最小范围。
我在 python 中使用 Google 驱动器 API。
从你的问题中,发现可以使用https://www.googleapis.com/auth/drive
。从这种情况来看,作为下载文件的scope,我觉得可以用下面的scope
https://www.googleapis.com/auth/drive.readonly
The official document 对这个范围的描述如下。
Allows read-only access to file metadata and file content.