Question

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!

Était-ce utile?

La solution

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.

Autres conseils

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);

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

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top