OAuth has become a programming gateway to most of the applications such as Facebook, LinkedIn, Twitter, Klout or DropBox. Without OAuth it is impossible to invoke their APIs. OAuth provides a very convenient and safe way to authenticate 3rd party applications on your behalf. So for example if I want to develop an application to search Facebook and LinkedIn for a Contact just added in Salesforce and if found, insert the social information in contact object.
How can I do this?
Theoretically, I will write a trigger which will invoke an asynchronous web service call out to Facebook and LinkedIn APIs. But in order make this call, the user must authenticate my application. In other words user must permit my application to run on his/her behalf and query Facebook and LinkedIn. This can only be achieved by OAuth.
Using OAuth especially 1.0 version of OAuth could be extremely tedious assuming you are using the libraries such as Python and Java. Without these libraries it could be ten times more difficult. And unfortunately there are no libraries written in Apex for Salesforce developers. So I had decided to write my own and completed code for 2.0 version and tested for Facebook. I will be publishing my code in my future blogs. Please give me your suggestion. Constructive criticism is highly appreciated.