我们需要隐藏 google oauth 客户端 ID 吗?

Do we need to hide the google oauth client id?

各位。我最近在学习 OAuth 身份验证。我正在玩弄 google 的 oauth api。在Google Sign-In for server-side apps的教程中,在第三步-初始化GoogleAuth对象中,您需要提供客户端id来初始化GoogleAuth对象。我只是想知道我们是否需要对客户端 ID 保密,因为现在任何人都可以通过查看 javascript 来找出客户端 ID 是什么。

您不需要隐藏客户端 ID,前提是您在服务器端限制了对特定 JavaScript 来源和重定向 URI 的访问。在 this Quora thread or this IETF thread.

上查看更多详细信息