admin管理员组

文章数量:1320780

I'm implementing a Chrome extension, which needs to access a 3rd party API endpoint using a token.

How do I store a token securely in the Chrome extension, assuming other Chrome extension scripts can access the page's localStorage & cookie?

I'm implementing a Chrome extension, which needs to access a 3rd party API endpoint using a token.

How do I store a token securely in the Chrome extension, assuming other Chrome extension scripts can access the page's localStorage & cookie?

Share Improve this question edited Mar 17, 2014 at 18:18 Keven Wang asked Mar 7, 2014 at 1:11 Keven WangKeven Wang 1,2781 gold badge19 silver badges30 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 6

Other scripts cannot access your storage. But a user can always debug your script and see it. You wont be able to encrypt it. At most you can obfuscate it.

I too don't see how it could be done. The only ways seem to be either calling your server and have server do the request that involves using the API key or obfuscate it for example by converting to base64 string in code but even then it'll be visible in developer tools network tab

本文标签: javascriptSecurely store tokenpassword in Chrome extensionStack Overflow