【问题标题】:what are other options for avoiding to expose google api key避免暴露 google api 密钥的其他选择是什么
【发布时间】:2017-01-03 06:42:36
【问题描述】:

创建与 youtube 数据 api 一起使用的 chrome 扩展程序时,会使用 api 密钥。但是,除了要求用户在他们的帐户中创建他/她自己的 api 并输入以在扩展?

【问题讨论】:

  • 根据documentation,如果您不想使用 API 密钥,可以使用 OAuth 2.0 凭据。

标签: api google-chrome-extension api-key


【解决方案1】:

我会参考 Google 的最佳做法。

https://support.google.com/cloud/answer/6310037?hl=en

【讨论】:

  • 虽然理论上可以回答这个问题,it would be preferable 在这里包含答案的基本部分,并提供链接以供参考。
【解决方案2】:

您可以使用OAuth 2.0 credentials,通过chrome.identity API 获取访问令牌,然后在 XMLHttpRequests 中使用该令牌。

【讨论】:

    猜你喜欢
    • 2018-08-04
    • 2020-01-29
    • 2022-01-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-07-13
    • 2023-03-25
    • 1970-01-01
    相关资源
    最近更新 更多