I am in the process of creating a simple Web Service for a Client of our's who wants the ability to retrieve shopping cart information and add/update items in the cart. I have written a CFC with a remote method for each. Now, obviously when these CFC methods are set to access="remote"
, the entire world can call them as is. However, I need to enable security to ensure that the only people that can call these methods remotely (not from within my website) are those that I've given permission to. And I don't want it to be intrusive (forcing a login, etc.).
For example, the Web Services exist on http://www.mywebsite.com and I only want to permit requests from http://www.yoursite1.com and http://www.yoursite2.com. Using HTTP_REFER
is no good, since this can be spoofed. How can I do this? Is it possible to use a self-signed certificate to somehow verify that the request is allowed?
NOTE: I'd also like to be able to use these Web Services for calls from our own website, so I'll need a solution that works for both scenarios.