Thank you for your reply! I really need help on this. Trying to solve
it since a couple of days.
I tried to use it the same way and I am using https, but it does not
work.
Calling the Authorization works pretty well:
oauth.get('
https://api.linkedin.com/uas/oauth/requestToken',
function(data) {
requestParams = data.text;
$('#oauthStatus').html('<span style="color:blue;">Getting
authorization...</span>');
alert(requestParams);
window.plugins.childBrowser.showWebPage('https://
www.linkedin.com/uas/oauth/authorize?'+data.text,
{ showLocationBar : false });
},
function(data) {
alert('Error : No Authorization');
$('#oauthStatus').html('<span style="color:red;">Error
during authorization 2</span>');
}
);
When the childbrowser is changing the location the the parameters are
extracted using this
var index, verifier = '';
var params = loc.substr(loc.indexOf('?') + 1);
params = params.split('&');
for (var i = 0; i < params.length; i++) {
var y = params[i].split('=');
if(y[0] === 'oauth_verifier') {
verifier = y[1];
}
}
After having the verifier I am trying to get the access Token like
this:
oauth.get('
https://api.linkedin.com/uas/oauth/
accessToken?oauth_verifier='+verifier+'&'+requestParams,
function(data) {
var accessParams = {};
var qvars_tmp = data.text.split('&');
for (var i = 0; i < qvars_tmp.length; i++)
{
var y = qvars_tmp[i].split('=');
accessParams[y[0]] =
decodeURIComponent(y[1]);
}
//alert('AppLaudLog: ' +
accessParams.oauth_token + ' : ' + accessParams.oauth_token_secret);
$('#oauthStatus').html('<span
style="color:green;">Success!</span>');
oauth.setAccessToken([accessParams.oauth_token,
accessParams.oauth_token_secret]);
// Save access token/key in localStorage
var accessData = {};
accessData.accessTokenKey =
accessParams.oauth_token;
accessData.accessTokenSecret =
accessParams.oauth_token_secret;
console.log("AppLaudLog: Storing token key/
secret in localStorage");
localStorage.setItem(localStoreKey,
JSON.stringify(accessData));
// alert("Now lets use the api with our
accesstoken");
window.plugins.childBrowser.close();
},
function(data) {
alert('Error : No Authorization');
alert("AppLaudLog: 1 Error " + data);
$('#oauthStatus').html('<span
style="color:red;">Error during authorization - After SignIn</span>');
}
);
Twitter is working fine, but linkedin not! If you take a look at these
slides, everything is going right till slide 18:
http://www.slideshare.net/episod/linkedin-oauth-zero-to-hero
Thank you in advance for any help.
Irfan
On 25 Jun., 06:16, Rob Griffiths <
r...@bytespider.eu> wrote:
> Looking at the documentation it should be as straight forward as the twitter example. Make sure your urls use https as any redirects will break the signing process
>