简体   繁体   中英

Javascript how to hide Consumer Key and Sercret in WebApp?

I am building a webapp which is supported by Parse as the backend. When using Parse, I have to add Consumer key and secret to every request. As we know, if we use Parse in iOS or Android App, it is ok because source code would not be released. However, in web app, someone can read the source code of my web and then get my Parse Consumer key and sercret, and then even hack my Parse data.

I am wondering if there is an approach that I can hide my Consumer key and secret when building web app.

Thank you for any help!

Ok, well if you only use JavaScript it's going to be difficult to hide this kind of information. But if you use a Scripting Language like PHP, Ruby, Node.js etc you can easily hide this information. You could catch every request you make from JS to the 3rd party application and add the keys and secrets on the server side, so its not exposed to the public.

Let me know if this was useful or if you have another question.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM