Google Chrome 扩展程序中密码的存储
我开始阅读 Google Chrome 的文档,并且喜欢它使用 HTML 和 Javascript 创建扩展的方法。阅读关于本地存储的本教程让我思考了很多不同的用途。
我想开发一个扩展来帮助我处理公司系统。它非常具体,并且只会在公司内部使用。
该扩展程序将使用 javascript DOM 对该公司系统执行一些活动,只需单击 Google 的 Chrome 工具栏即可。为了只需一键点击,扩展程序需要在 Chrome 中存储密码:因此,如果您重新启动系统,则无需再次输入密码。
我该怎么做?在 Google Chrome 扩展程序中保留密码以登录另一个系统?我不想将其存储在“纯文本”中,我想至少使用某种加密(可能是具有此资源的 Google Chrome API)。
是否可以?如何使用 Google Chrome 的扩展结构保存这些数据(最佳方法)?
I started reading Google Chrome's documentation, and liked it's approach of using HTML and Javascript to create extensions. Reading this tutorial about Local Storage made me think about a lot of different uses.
I want to develop an extension to help me with corporate systems. It's very specific, and it's only going to be used inside a company.
This extension would do some activities to this corporate system, using javascript DOM, with just one click on Google's Chrome toolbar. To work with just one click, the extension needs to store a password in Chrome: so if you restart your system, you don't need to enter it again.
How do I do that? Persist a password in a Google Chrome extension to login to another system? I don't want to store it in "plain text", I would like to at least use some kind of encryption (maybe a Google Chrome API with this resource).
Is it possible? How do I persist this data with Google Chrome's extensions structure (best way)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用
localStorage
(或Web SQL 数据库 API)。但不是很安全。任何有权访问用户计算机的人都可以检索密文,从扩展源中提取加密算法,并确定明文密码。如果可行,这里有一些更可靠的解决方案:
搭载用户登录到 Web 界面。有关示例,请参阅 Google Mail Checker。
通过 OAuth(或类似的授权方案)连接到服务。有关示例,请参阅 Google Wave Notifier。
You could encrypt and store a user’s password with
localStorage
(or the Web SQL Database API). But not very securely. Anyone who gained access to the user’s computer could retrieve the ciphertext, pluck the encryption algorithm out of your extension source, and determine the plaintext password.If feasible, here are a couple more bulletproof solutions:
Piggyback on the user logging into a web interface. For an example, see the Google Mail Checker.
Connect to the services through OAuth (or a similar authorization scheme). For an example, see the Google Wave Notifier.