Google 针对已安装应用程序的 Oauth 与针对 Web 应用程序的 Oauth
所以我在理解某些事情时遇到了困难...
如果您对 Web 应用程序进行 Oauth,您可以使用回调 URL 注册您的网站并获得唯一的消费者密钥。但是,一旦您获得了 Oauth for Web Apps 令牌,您就不必从您的注册域生成对 google 服务器的 Oauth 调用。我经常使用通过笔记本电脑上的本地主机上的 apache 服务器运行的脚本中的密钥和令牌,并且 Google 从来不会说“您没有从注册域发送此请求”。它只是向我发送数据。
现在,据我了解,如果您对已安装的应用程序进行 Oauth,您将使用“匿名”而不是从 Google 获得的密钥。
我一直在考虑仅使用 OAuth for Web Apps 身份验证方法,然后将该令牌传递给已安装的应用程序,该应用程序的内部嵌入了我的秘密代码。担心的是代码可能会被坏人发现。但是什么更安全......让他们为密码工作还是让他们默认为匿名?
如果当替代方案使用“匿名”作为秘密时发现“秘密”,那么真正会出现什么问题呢?
So I'm having trouble understanding something...
If you do Oauth for Web Apps, you register your site with a callback URL and get a unique consumer secret key. But once you've obtained an Oauth for Web Apps token, you don't have to generate Oauth calls to the google server from your registered domain. I regularly use my key and token from scripts running via an apache server at localhost on my laptop and Google never says "you're not sending this request from the registered domain." It just sends me the data.
Now, as I understand it, if you do Oauth for Installed Apps, you use "anonymous" instead of a secret key you got from Google.
I've been thinking of just using the OAuth for Web Apps auth method, then passing that token to an installed app that has my secret code embedded in its innards. The worry is that the code could be discovered by bad people. But what's more secure... making them work for the secret code or letting them default to anonymous?
What really goes bad if the "secret" is discovered when the alternative is using "anonymous" as the secret?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Web 应用程序的 OAuth 和已安装应用程序的 OAuth(例如“匿名”/“匿名”作为您的消费者密钥/秘密)之间的主要区别在于批准页面。
对于已安装的应用程序,Google 无法验证其身份
应用程序中,会向用户显示一个黄色警告框。
对于网络应用程序,有一个可以验证的(应用程序的)实际 URL。
因此,不会向用户呈现丑陋的警告框。
The main difference between OAuth for Web Apps and OAuth for Installed Apps (e.g. "anonymous"/"anonymous" as your consumer key/secret), is the approval page.
For installed apps, there is no way for Google to verify the identity of the
application so a yellow warning box is shown to the user saying so.
For web apps, there's an actual URL (of the app) that can be verified.
Hence, no ugly warning box is presented to the user.
在进行 OAuth 调用时,您唯一需要识别自己身份的是签名,它是使用您的消费者密钥签名的 HMAC-SHA1 字符串。与任何域都没有任何关系。
您唯一需要保持合理安全的就是消费者秘密。我不太明白你所说的“匿名”是什么意思......
The only thing you need to identify yourself when doing an OAuth call is the signature which is a HMAC-SHA1 string signed with your consumer secret. There's no relation with any domain whatsoever.
The only thing you need to keep reasonably safe is the consumer secret. I don't quite get what you mean by "anonymous" though...