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 badges2 Answers
Reset to default 6Other 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