3

I have done linkedin oauth api in my local. API response from linkedin is working fine in localhost. When I've moved to server, i got error in linkedin api on the server like as follows.

oauth_problem=timestamp_refused&oauth_acceptable_timestamps=1349951029%2B-300

can any one help me? Thanks in advance!

jeeva
  • 1,573
  • 2
  • 15
  • 24

3 Answers3

2

FIRST SEE WHAT IS THE TIME DIFFERENCE BETWEEN THE WEBSERVER AND THE LINKEDIN SERVER

in linkedin.php there is a function [fetch] and do at the end of function

echo '<pre>';
print_r($return_data);
exit;

you will see the [oauth_timestamp] which your server is sending and at the $return_data print data there is a timestamp which linkedin server is sending.

convert both of them and see the difference you can do at this site. http://www.epochconverter.com/

at last

In OAuth.php file there is a function [generate_timestamp] which is returning a time(). By changing it to

#to avoid the error of 
#oauth_problem=timestamp_refused&oauth_acceptable_timestamps=
#return time()+(difference of mints*sec);
return time()+(40*60);
khalrd
  • 60
  • 6
0

This happened to me in the past. Most people suggest that the clock on your system is wrong. Try checking this, if it doesn't work, try re-authenticating to get a new access token while the script runs on your server, if you haven't done so yet.

Your last option would be to use a different library. I've found out that some libraries are a bit unstable. If you're using PHP, I would recommend you use simple-linkedinphp. The best I have used so far.

Samer Bechara
  • 2,099
  • 16
  • 24
0

Check your server timing. Because I faced the same issue. After I set the correct time and date it worked fine.

Rohit Gupta
  • 4,022
  • 20
  • 31
  • 41
TS Guhan
  • 195
  • 2
  • 10
  • This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post - you can always comment on your own posts, and once you have sufficient [reputation](http://stackoverflow.com/help/whats-reputation) you will be able to [comment on any post](http://stackoverflow.com/help/privileges/comment). – RMcLeod Oct 26 '15 at 14:30
  • I cannot add my comment for this post. If someone face the same issue it will be helpful for them. To add my comments i need to get more than 50 reputation. – TS Guhan Oct 26 '15 at 18:46