Home » Cloud » Apex and OAuth

Apex and OAuth

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.




  1. Tal Galili says:

    Hi there,
    Nice post, but it is not related to R.
    Your post is removed.
    In order to avoid this in the future, I am stopping this feed from syndicating on r-bloggers.com

    In order to add your feed again, you are invited to resubmit your feed, this time with an R specific feed – and explain the the form that this is a resubmission.


  2. thanks! great web site. thank you for the information this site is amazing. very well developed with great information. lista de emails lista de emails lista de emails lista de emails lista de emails

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: