Reasons for "invalid or expired token"


#1

Hello,

What are the possible reasons that can cause token to get expired (besides having the user un-authorising the app)?

My problem is that i have an app with several thousnds of users, all API communication works perfectly but for some users im getting the “invalid or expired token” error, my initial though was that they are users who canceled the authentication to the app but i’ve contacted some of them and they havent revoked the access.

any ideas what other issues can cause that error?


#2

When this problem occurs, I assume it’s on oauth/authorize or oauth/authenticate, correct? Is there an oauth_token value in your URL when this happens? If there isn’t, review what happens when you leverage oauth/request_token – would you still send a user to oauth/authorize if you didn’t receive a valid request token on that step?


#3

it doenst happen on oauth/authorize nor oauth/authenticate.
after users sign up to my service, they authorize their Twitter account.
from that point i am making API calls to interact with the user’s Twitter account.
from some reason, lately, for some of the users, im getting the “invalid or expired token” error when trying to make API calls (cant say its for a specific endpoint).
i’ve contact some of the users and i know they did not revoked access to my app so i don’t know what can cause that.
BTW, I am using the Twitter gem to interact with the API.

any ideas what can cause that?