How To Keep Api Keys Secret When Using Client Side Javascript?
For example, check out this Facebook plugin. In the client side the API key is clearly visible. What is stopping another user from obtaining this key and using this feature on a di
Solution 1:
In three words: server-side validation. FB itself will throw an error when you use a key that's incorrect for the given site. The API key is not supposed to be secret (as opposed to the secret key).
Solution 2:
I haven't done this myself, but I know that the kind of attack you are worried about is called Cross-site Request Forgery (CSRF). The Wikipedia article on that gives some hints on how to prevent it.
Post a Comment for "How To Keep Api Keys Secret When Using Client Side Javascript?"