Google 驱动 API 身份验证

Google Drive APIs Authentication

当我要"Google Drive APIs"认证时,我应该可以访问我的电子邮件和密码供用户批准,没有这些就无法连接。 有没有一种解决方案可以在不让我的电子邮件用户隐私访问应用程序的情况下提供?

您可以避免从用户那里获取 "email and profile" 范围,而只需为您的应用程序询问 "drive" 范围。如果这样做,您将无法访问用户的电子邮件地址,但您可以create/modify 用户云端硬盘中的所有文件。

如果您对身份验证过程感到困惑 - 用户在任何情况下都不要向您透露他们的 google 密码。因为身份验证由 google 负责,作为响应,您只会在身份验证成功后获得访问令牌。

看看这些链接。

OAuth: https://developers.google.com/identity/protocols/OAuth2

范围: https://developers.google.com/drive/web/scopes