oauth - Dart Web 应用程序 - 当我有客户端 ID OAuth2 时为什么需要 API key ?

标签 oauth google-drive-api dart

我有一个 Dart-Polymer [仅限客户端] 网络应用程序,我希望用户通过 Google Drive 共享数据。我希望用户能够将文件“另存为”到 gdrive 上,然后在另一个上读取/导入它。

我已经从 Google Developer Console 设置了凭据。

该应用程序已成功授权(使用客户端 key ),但我得到 API 开发者 key 无效 当我尝试列出驱动器上的文件时。我已经在 Google Developers Console 中创建了 API key (支付了几个),尽管文档说如果我有 OAuth2 客户端 ID,我不需要这样做。

请问有什么想法吗?

干杯
史蒂夫

最佳答案

我不认为这与 Dart 无关。使用文件选择器(也使用 Dart )时,我遇到了类似的问题。我记得必须启用“Google Picker API”。

您需要确保为定义了客户端 key 的项目(在 https://console.developers.google.com/apis 中)启用了正确的 API(Drive API 和最终的 Google Picker API,如果您使用它来选择文件/文件夹)。

还要确保您在授权中请求了正确的范围(例如 https://www.googleapis.com/auth/drive )

关于oauth - Dart Web 应用程序 - 当我有客户端 ID OAuth2 时为什么需要 API key ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36186112/

相关文章:

google-drive-api - 如何使用 google drive api for python?

python - 如何使用服务帐户凭据将文件上传到谷歌驱动器

flutter - 如何在 TableRow 中为 Flutter Table 设置表格列大小

node.js - 将 OAuth 与 Kuzzle 集成

c# - 使用 oauth 访问 gmail 的电子邮件

php - Twitter REST API,更新状态?

oauth - 在 Stripe Connect OAuth 回调后将应用程序用户与 Stripe 用户相关联

Ubuntu Google Drive Nautilus 自动备份

flutter - 将setState public var摇晃到另一个页面?

flutter : Unhandled Exception: setState() called after dispose() occurs when refreshing the page