Code 89/Token Expired when using OAuth library with Classic ASP


Hello all,

I am using the classic ASP OAuth library by Scott DeSapio ( and I’m running in to a code 89/expired token problem. What I’m trying to do is post some text to my twitter account after posting it to my website. To do this, I’m calling on twitter to get the token and token_secret and then trying to use that immediately afterwards to post my status, but it keeps telling me everything is expired. I know I’m getting both token and token_secret returned, but other than that I’m not sure why they would be expired. Can anyone guide me to what I’m doing wrong?

				Dim objOAuthReceive : Set objOAuthReceive = New cLibOAuth
				objOAuthReceive.ConsumerKey = twitter_consumer_key
				objOAuthReceive.ConsumerSecret = twitter_consumer_secret
				objOAuthReceive.Host = ""
				objOAuthReceive.RequestMethod = OAUTH_REQUEST_METHOD_GET
				objOAuthReceive.TimeoutURL = OAUTH_EXAMPLE_TIMEOUT_URL
				objOAuthReceive.UserAgent = "Alert System Updater"
				Dim strRequestToken : strRequestToken = objOAuthReceive.Get_ResponseValue(OAUTH_TOKEN)
				Dim strRequestTokenSecret : strRequestTokenSecret = objOAuthReceive.Get_ResponseValue(oauth_token_secret)
				Set objOAuthReceive = Nothing
				Dim objOAuthSend : Set objOAuthSend = New cLibOAuth
				objOAuthSend.ConsumerKey = twitter_consumer_key
				objOAuthSend.ConsumerSecret = twitter_consumer_secret
				objOAuthSend.EndPoint = ""
				objOAuthSend.Host = "" ' required for twitter apps
				objOAuthSend.RequestMethod = "POST"
				objOAuthSend.UserAgent = "Alert System Updater" ' required for twitter apps

				objOAuthSend.Parameters.Add "oauth_token", strRequestToken
				objOAuthSend.Parameters.Add "oauth_token_secret", strRequestTokenSecret
				objOAuthSend.Parameters.Add "status", tstatus


				Dim strResponseText : strResponseText = objOAuthSend.ResponseText
				Dim strErrorCode : strErrorCode = objOAuthSend.ErrorCode
				If Not IsNull(strErrorCode) Then
					Response.Status = RESPONSE_STATUS_500
					Response.Write strErrorCode
					Response.ContentType = "text/html"
					Response.CharSet = "utf-8"
					Response.Write strResponseText
				End If
				Set objOAuthSend = Nothing


Sorry to do this, but I’m bumping this post because I’m still looking for an answer.


Hi John,

The trusty old open source library ASPTwitter was recently updated to support Twitter API 1.1 with OAuth etc. This has the code you need and a working demo, in case it helps:

I used ASPTwitter today and it works nicely with the current API. :slight_smile:


Hi John, see my reply below. :slight_smile:


Thanks Tim, it’s much appreciated.


My pleasure – if there’s anything I can do to help, let me know. If you add any new API endpoints to my ASPTwitter library, e.g. to post tweets, feel free to send me the code and I’ll update the Zip file so others can use it.