2

I was wondering if anyone got this working. I am trying to do a basic authentication but for some reason it keeps complaining "Could not authenticate you.". How would I go about getting it to run with OAUTH?

Legend
  • 113,822
  • 119
  • 272
  • 400

2 Answers2

4

I have a tutorial written for this a while back. You can get it on my blog here, it's lengthy so I won't repost it here

Bostone
  • 36,858
  • 39
  • 167
  • 227
  • I am very new to the OAuth concepts. I am trying to read but I don't understand what OAUTH_VERIFIER is and where to define that. Could you provide me a bit of help on that? – Legend Oct 29 '09 at 16:35
  • Also, it keeps giving me "oauth.signpost.exception.OAuthExpectationFailedException: Request token or token secret not set in server reply. The service provider you use is probably buggy." no matter how I try to do it... I checked your blogpost but I still seem to be doing something wrong. Any suggestions on that regard? – Legend Oct 29 '09 at 17:01
  • OAUTH_VERIFIER is nothing more than a static String `public static final String OAUTH_VERIFIER = "oauth_verifier"` The way Twitter's OAuth works (in the nutshell) - when you register your app w/Twitter you are given a request token. With that token your user can go to the Twitter site and exchange his credentials + request token for the authentication token which your Android app will save and use on user's behalf to grant user access to Twitter API. – Bostone Oct 29 '09 at 18:14
  • BTW - app you register on Twitter and your own Android app are not the same it's 2 totally different things – Bostone Oct 29 '09 at 18:15
1

The signpost solution is a lot of extra work.

There's a way to do it wither Twitter4j that only takes a few lines of code. The solution comes from Stephan, here.

I have an example app using his approach, here.

Community
  • 1
  • 1
Jameson
  • 6,400
  • 6
  • 32
  • 53