I have a PHP webservice that I need to add exclusive access to. This I could do with md5sums or similar, but my problem is that I also have a website that calls the webservice from javascript. So any keys, md5sums, and what I can think of can be read in the javascript and does not provide much security. For example an url like http://my-webservice.com?supersecretkey=omg is easy to read in the javascript and replicate.
What would be the best approach? Sessions? Oauth? I have researched a bit, but I keep running into the problem that most examples are not so that they can be called from javascript.