4

I read a lot about signpost, and then went back to Twitter4J with which I have created my twitter applications when OAuth wasn't necessary.

I am now confused whether I should use signpost or Twitter4J's method of OAuth authentication.

I have read that Twitter4J itself uses signpost for OAuth, still am not sure about the choice that I should make.

Kindly assist.

Thanks a lot!

Aman Alam
  • 11,231
  • 7
  • 46
  • 81

2 Answers2

8

I was looking for an answer to this question because:

  • If I use SignPost, I can get the "Sign-in with Twitter" working
  • If I had used Twitter4J, then I had to ask the user for his uid/pass

Although I wanted to use Twitter4J only.

Anyhow, I devised a way between these two and used Twitter4J to achieve "Sign-in with Twitter".

Aman Alam
  • 11,231
  • 7
  • 46
  • 81
  • and here's the full blog post and a sample project demonstrating the things: http://goo.gl/ZW4om – Aman Alam Jan 14 '11 at 12:36
  • @Sheikh Aman your source code link in your blog post no longer works, could it be possible to get an update – Nathan Schwermann Apr 12 '11 at 19:07
  • Thanks for pointing that out. Yes it wasn't really working since I had changed the domain name of my website. Please check it now, I have rectified it – Aman Alam Apr 13 '11 at 03:41
  • @Sheikh Aman thanks its working now, but it seems you have to now email api@twitter.com in order to get the custom protocol in your callback url. Is that right? – Nathan Schwermann Apr 13 '11 at 05:04
  • really? I need to check that, since it wasn't like this at the time when I wrote this tutorial. I'll just check – Aman Alam Apr 13 '11 at 05:16
  • I just registered one test application (not a client one, but a 'web' one) and it didn't ask for any email. maybe its location dependent. I don't know o_O – Aman Alam Apr 13 '11 at 05:32
  • when I try to enter the callback url schwiz://main it says 'you are trying to enter a custom protocol please email api@twitter.com and we will set it up for you' – Nathan Schwermann Apr 13 '11 at 14:39
  • Ohh.. don't use it over there. give any valid web URL (http URL) at twitter's end, and use this inside your Android application. Look at the code. Although I plan to eliminate this confusing stuff by including a WebViw that reacts as a mini browser – Aman Alam Apr 13 '11 at 16:50
  • yeah that seems like a better approach just overriding shouldOverideLoading in a webview rather than relying on intent-filters – Nathan Schwermann Apr 13 '11 at 18:25
  • Yes, try that out, and if you could make it as a sample, give it to me so that I can upload it on this git, or upload it yourself somewhere – Aman Alam Apr 13 '11 at 19:06
  • Here is my take using a WebViewClient instead of an intent-filter and Scribe instead of Twitter4J http://schwiz.net/blog/2011/using-scribe-with-android/ – Nathan Schwermann Apr 14 '11 at 03:09
5

Twitter4J has no dependency and it's got its own OAuth support implementation.

You can achieve sign-in-with-twitter with Twitter4J. Here you can find an example webapp. https://github.com/yusuke/sign-in-with-twitter

YAMAMOTO Yusuke
  • 732
  • 4
  • 5
  • 2
    Wow.. the creator posted! Thanks! Well I referred to that example only and created an Android version of Sign-in with twitter. And it works pretty well. it opens the Android browser for the user to sign in, and when the user finishes signing in, it returns to the app with the details twitter returned, and further uses Twitter4J for twitter Transactions. would you like to see the code? – Aman Alam Dec 03 '10 at 07:20
  • @Yusuke Yamamoto, gr8 job. – Ritesh Gune Apr 02 '14 at 11:55