[jQuery] Using some sort of client identification in javascript
Hi all,
I have a problem which is moderate in difficulty. It doesn't apply
directly to jQuery -- but given the general aptitude of the users on
this list, I figured I'd be able to pick some brilliant minds.
I'm writing an API in jQuery which I'd like to distribute to my
clients to use on their sites. Each client needs their own ID so I
know how to collect data relating to their entity on my own back end.
This is very similar to what Google Analytics does, I think. (It isn't
for collecting statistics though, I'm collecting other data such as
form submissions). Ultimately though, I will need a way to associate a
client with their copy of the API, and I need a way to verify that a
client is legit when I process their requests which will be done using
an XHR and server-side proxy code.
I need to be able to on the server-side ensure that the client
submitting data to me with their client ID is indeed privileged to do
so. Perhaps I can setup a table that associates IP addresses with the
particular client ID in addition to some sort of PTR/DNS
verifications? Any other preventive measures I can take to tighten my
data integrity and security risks?
I ultimately want to spit back a message to a client who just
copy/pastes the JavaScript from a legitimate client into their own
browser saying "No cigar". If anyone has any white papers or
documentation that describes best practices for this, or can just give
me general ideas -- I should be able to formulate it into a production
setup.
Thank you for your 2 cents folks, really appreciate it.
/sf