YouTube 数据 API - 处理客户机密

YouTube data API - Handling Client Secrets

我正在开发一个 server/client 应用程序,它允许将视频剪辑发布到用户的 YouTube 频道。我们的软件部署在客户拥有并控制的服务器上。

我正在使用 YouTube 的 Java API v3 和 OAuth 2.0。

我的问题是 - 在这种情况下我应该如何管理客户端机密

我曾考虑将我自己的客户端机密嵌入到服务器代码中,但配额和使用情况将由我负责。我不确定要求客户获得他们自己的 Google 开发者帐户并生成他们自己的客户机密是否明智...

谢谢!

要管理客户端机密(您可能已经知道),请在您的代码中包含 client_secrets.json,如前所述 here

在您的场景中,建议要求客户获得自己的帐户并生成自己的客户端机密。如您所见here,在第 1 部分:帐户和注册 下,它说:

b. Entity Level Acceptance. If you are using the APIs on behalf of an entity, you represent and warrant that you have authority to bind that entity to the Terms and by accepting the Terms, you are doing so on behalf of that entity (and all references to "you" in the Terms refer to that entity).

因此,在这种情况下,您的客户接受使用 Google API 的条款和条件也很重要,该条款和条件约束他们对任何滥用 API 并且不涉及你。作为一个vendor/business,远离这些东西总是明智的。因此,要求他们提供自己的客户机密不应该是您应该担心的事情。如果他们担心接受 Google 的服务条款,我会担心他们不怀好意。

希望对您有所帮助。