Linkedin tokens expire in a day instead of 60 days
Asked Answered
F

1

9

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?

Fluker answered 6/9, 2017 at 18:52 Comment(0)
J
3

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.

Janinejanis answered 9/9, 2017 at 4:10 Comment(2)
What do I need to do to fix the issue?Fluker
I edited the response. It is tricky w/o seeing any code, but I hope it helps.Janinejanis

© 2022 - 2024 — McMap. All rights reserved.