Help with OAuth in VB

Jul 21, 2013 at 1:12 PM
Edited Jul 21, 2013 at 6:07 PM
Hi,

I've saved my account details in a database and retrieving it through the code which includes consumerkey, consumersecret, userID, screenName, OAuthToken and Access token.
Assigning it to credentials after retrieval.

Following is my code..
                credentials.ConsumerKey = ds.Tables("Accounts").Rows(x)("ConsumerKey")
                credentials.ConsumerSecret = ds.Tables("Accounts").Rows(x)("ConsumerSecret")

                credentials.UserId = ds.Tables("Accounts").Rows(x)("UserID")
                credentials.ScreenName = ds.Tables("Accounts").Rows(x)("ScreenName")
                credentials.OAuthToken = ds.Tables("Accounts").Rows(x)("OAuthToken")
                credentials.AccessToken = ds.Tables("Accounts").Rows(x)("AccessToken")

                auth = New PinAuthorizer()
                auth.Credentials = credentials
               ' auth.GetPin = AddressOf VerifierCallback
               ' auth.GoToTwitterAuthorization = Function(pageLink) Process.Start(pageLink)
                auth.Authorize()

                twitterCtx = New TwitterContext(auth)

Dim statusMsg As String = txtMessage.Text

            If statusMsg.Length > 140 Then statusMsg = statusMsg.Substring(0, 139)

            Dim tweet = twitterCtx.UpdateStatus(statusMsg)
When it comes to the last line it shows "Invalid or Expired Token." Some 401 error code as well.

Please help me out figuring whats missing asap.


Thanks..
Jul 21, 2013 at 7:14 PM
OK. I figure out the solution by changing pinauthorizer to SingleUserAuthorizer.


;)

Thanks anyways..