+ Start a Discussion

Using client certificates with webservice methods

If I create a webservice method in Apex code is there any way that I can use client certificates to autheticate the inbound web service calls?

For example, suppose I have the following class:
global class MyWebService {
	    webService static Id makeContact(String lastName, Account a) {
	        Contact c = new Contact(lastName = 'Weissman', AccountId = a.Id);
	        insert c;
	        return c.id;
Obviously, if I enable this in Sites, then someone could call this method from outside of Salesforce.  If this web service was hosted in my own web server, I could require all clients to provide a certificate (two-way SSL).  Is there any way that I do the same for my web service in Salesforce?