Question

I am building a web app from where the user can manage his twitter account. I've created the twitter app and once the user authenticates himself the application gets the access token from twitter. Does this access token expire or I can store it and make request, on user's behalf, without asking from him to log in again ?

Was it helpful?

Solution

Here is what they saying in there development page

Question: How long does an access token last?

Access tokens are not explicitly expired. An access token will be invalidated if a user explicitly revokes an application in the their Twitter account settings, or if Twitter suspends an application. If an application is suspended, there will be a note in the Twitter app dashboard stating that it has been suspended.

More details can be found here

FAQ Twitter

OTHER TIPS

From the Twitter API error codes it looks like it can expire:

API request contains invalid bearer token Using an incorrect or revoked bearer token to make API requests will result in:

HTTP/1.1 401 Unauthorized Content-Type: application/json; charset=utf-8 Content-Length: 61 ...

{"errors":[{"message":"Invalid or expired token","code":89}]}

Source link: https://dev.twitter.com/oauth/application-only

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top