I was requested by a client to pull the latest posts from their LinkedIn group onto one of our website pages.
I have been developing ColdFusion 9 for quite a few days and decided to post my request here in the hope that someone could help me.
I can get to the point where I have requestToken. I understand that now I need to sign a request token in order to get accessToken. My problem is that I need to do this off-screen. However, all the examples that I can find redirect the front-end user to the authorization URL to allow the user to authenticate, but I do not want the user to authenticate, instead I want to authenticate the server side.
I am trying to use the Java Scribe cover library. Below is the code that I still have that receives the requestToken (as well as the authorization URL). I need someone to point me in the right direction in order to sign a token on the server code so that I can make the necessary calls to use the groups API (for example, http://api.linkedin.com/v1/groups/{id}/posts?count=5&start=1)
<cfscript>
var l = {};
l.oauth_consumer_key = "[My public key]";
l.oauth_sign_key = "[My secret key]";
l.serviceBuilder = CreateObject("java","org.scribe.builder.ServiceBuilder");
l.LinkedInApiClass = CreateObject("java", "org.scribe.builder.api.LinkedInApi").getClass();
l.service = l.serviceBuilder.provider(l.LinkedInApiClass).apiKey(l.oauth_consumer_key).apiSecret(l.oauth_sign_key).callback("[My callback url]").build();
l.requestToken = l.service.getRequestToken();
l.authUrl = l.service.getAuthorizationUrl(l.requestToken);
...
...
</cfscript>
source
share