为什么 Google 原生 oauth2 流程需要客户端密钥?
根据 facebook oauth2 文档,客户端流程不需要客户端秘密参数。客户端流程可用于本机和移动 Web 应用程序。
但是,Google 的本机 oauth2 流程需要客户端密钥 http://code.google.com /apis/accounts/docs/OAuth2.html#IA。
在这种情况下,黑客可以使用逆向工程工具窃取客户端机密。
有人可以澄清为什么这样做吗?
According to facebook oauth2 docs, client side flow doesn't require client secret param. Client side flow can be used on both native and mobile web apps.
However google's native oauth2 flow require client secret http://code.google.com/apis/accounts/docs/OAuth2.html#IA.
In this case client secret can be stolen by hacker using reverse engineering tools.
Can somebody clarify why it was done this way?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
根据一位 Google 员工的帖子,主要原因是他们对服务器端应用程序和本机应用程序使用相同的库。听起来他们不认为 client_secret 在本机应用程序的上下文中敏感,但他们计划最终在已安装的应用程序流程中逐步淘汰它。
来自 https://groups.google.com/group/oauth2-dev/browse_thread/thread /1e714924ebcc7e60/edfaaad5830ff2e8:
虽然这听起来可能很糟糕,但请记住,OAuth 从来都不是为了阻止恶意用户在您的移动/桌面应用程序的上下文中伪造请求。
如果您担心泄露 client_secret,这里还介绍了客户端流程:http: //code.google.com/apis/accounts/docs/OAuth2.html#CS 据我所知,客户端流程不需要 client_secret,并且可以在桌面或移动应用程序中正常工作。
-克里斯
According to a post from a Googler, the main reason is that they use the same libraries for server-side apps and native apps. It sounds like they don't consider client_secret to be sensitive in the context a native app, but they plan to phase it out for the installed app flow eventually.
From https://groups.google.com/group/oauth2-dev/browse_thread/thread/1e714924ebcc7e60/edfaaad5830ff2e8 :
While that might sound bad, keep in mind that OAuth was never intended to prevent malicious users from forging requests in the context of your mobile/desktop app.
If you're concerned about exposing client_secret, there is also the client-side flow described here: http://code.google.com/apis/accounts/docs/OAuth2.html#CS As far as I can tell, the client-side flow doesn't require client_secret and would work fine from a desktop or mobile app.
-Chris