JTwitter OAuth signpost example

Posted by RenegadeAndy on Stack Overflow See other posts from Stack Overflow or by RenegadeAndy
Published on 2010-06-05T19:59:26Z Indexed on 2010/06/05 20:02 UTC
Read the original article Hit count: 769

Filed under:
|
|
|
|

Hey.

I believe JTwitter supports OAuth to authenticate against a developer account , however i cannot get any of them working.

The JTwitter docs say signpost is the supported method - yet I cannot seem to find the OAuthSignpostClient class they use even after adding the signpost libs:

  OAuthSignpostClient client = new OAuthSignpostClient(JTWITTER_OAUTH_KEY, JTWITTER_OAUTH_SECRET, "oob");
    Twitter jtwit = new Twitter("yourtwittername", client);
    // open the authorisation page in the user's browser
    client.authorizeDesktop();
    // get the pin
    String v = client.askUser("Please enter the verification PIN from Twitter");
    client.setAuthorizationCode(v);
    // Optional: store the authorisation token details
    Object accessToken = client.getAccessToken();
    // use the API!
    jtwit.setStatus("Messing about in Java");

Has anybody code that code segment working?

Please help

Andy

© Stack Overflow or respective owner

Related posts about java

Related posts about api