如何使用 Google 身份工具包连接到 Google 驱动器 API?

How to use Google Identity Toolkit to connect to Google Drive API?

我想使用 Google Identity Toolkit to sign up and authenticate my users. In another part of my app, I want to use the Google Drive API 允许用户选择媒体文件 link 和他们的个人资料。

设置 GITKit 是否可以更轻松地使用 Drive API?我可以在这两个服务之间共享凭据(即 API 密钥)吗?他们是完全分开的吗?我很困惑,所以任何帮助将不胜感激。

首先,请考虑使用 Firebase Authentication,这是 Google Identity Toolkit 的新版本。

在 Firebase Authentication SDK 和 Google Identity Toolkit SDK 中,您的应用可以在初始化 Google 提供程序时指定 Google Drive 范围。这样,一旦最终用户使用 Google 登录您的应用程序,您的应用程序就可以获得 Google oauth2 访问令牌,该令牌具有 Google Drive 范围的权限。您的应用可以使用该访问令牌调用 Google 驱动程序 API,而不提示用户。