tags:

views:

87

answers:

2

I am trying to connect to twitter via TwitterVB and the following code does not work(note: removed the consumerKey and consumerKeySecret for privacy issues). When I run the following code it pops up a web page(Attached). What am I doing wrong?

Code: string consumerKey = ""; string consumerKeySecret = "";

    TwitterVB2.TwitterAPI tw = new TwitterVB2.TwitterAPI();
    if (Request["oauth_token"] == null)
    {
        Response.Redirect(tw.GetAuthorizationLink(consumerKey, consumerKeySecret));
        Debug.WriteLine(tw.OAuth_Token);
        Debug.WriteLine(tw.OAuth_TokenSecret);
    }
    else
    {
        tw.GetAccessTokens(consumerKey, consumerKeySecret, Request["oauth_token"], Request["oauth_verifier"]);
        Debug.WriteLine(tw.OAuth_Token);
        Debug.WriteLine(tw.OAuth_TokenSecret);
    }

Screenshot: http://picasaweb.google.com/110153104476017462305/Screenshots#5521379134576882050

A: 

In short: you need to get key and secret to have access to twitter account. And that could be done only with that form on the screenshot. But that should be done just once. So - give the permission and store key + secret somewhere.

And here are some useful links for you:

http://dev.twitter.com/pages/auth
http://hueniverse.com/oauth/
http://dev.twitter.com/pages/oauth_faq

zerkms
A: 

Hi, I'm the author of TwitterVB. :)

Your best bet is to read the web tutorial at the following link:

http://twittervb.codeplex.com/wikipage?title=OAuth%20Web%20Tutorial&referringTitle=OAuth

It spells it out pretty clearly. Third-party applications may no longer sign in to Twitter using username and password; you have to store the OAuth tokens.

DWRoelands