Storage of passwords in Google Chrome Extension

六眼飞鱼酱① 提交于 2019-12-29 04:13:05

问题


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)?


回答1:


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.



来源:https://stackoverflow.com/questions/3265348/storage-of-passwords-in-google-chrome-extension

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!