Friday, September 15, 2017

Linkedin tokens expire in a day instead of 60 days

Leave a Comment

Linkedin's API documentation states that the access token granted lasts for 60 days, but in some cases I've seen it expire within a day. Once we drive the user through the authentication process to get the access token, we are able to post on their page. But when we try posting for them the next day, the API returns an error "Unable to verify access token". There are pages where I don't see this issue and I've been posting for the last couple of weeks. My issue is that I can't figure out the difference between the pages where the tokens expire in a day and where they don't. Help?

1 Answers

Answers 1

I have seen the behaviour you describe only when after an authorization the access token was not updated in our db. An authorization will invalidate the previous token and the API calls will return that message.

Edit- response to comment: Make sure the database is updated with the tokens after each user authentication, ensure that the user is not going over the authentication again in some other place in the app without saving token (or requesting different permissions) because those two cases will generate that error message.

If You Enjoyed This, Take 5 Seconds To Share It

0 comments:

Post a Comment