Android -- Twitter Oauth -- Many different methods, none seem to work. Help
I can't get Oauth to work with Twitter. I have tried the following (all result in the same 401 error):
- jTwitter (using the default OauthSignpostClient)
- jTwitter using the commonshttp library (CommonsOauthProvider) instead of the "DefaultOauthProvider"
- jTwitter using the OauthScribeClient (instead of the OauthSignpostClient)
- oauth-signpost (by itself... no jTwitter)
- Twitter4J
- http://code.google.com/p/agirardello/
- http://dev.bostone.us/2009/07/16/android-oauth-twitter-updates/
- http://github.com/kaeppler/signpost-examples/blob/master/OAuthTwitterExample/src/TwitterMain.java
I've tried my own implementation and copy/pasted the sample code from each of the sites, and nothing seems to work. I'm also 100% sure I also downloaded and included any dependencies (where needed)开发者_如何学JAVA.
Here's the interesting part. Using jTwitter and the oauth-signpost library, I can initiate a connection to Twitter, open a browser window for the user, have them log-in and generate a PIN for my app. When the app goes to post a status update however, (using the pin, and the stored access token and token secret), the 401 error pops up. All other things I've tried won't even let me open a browser window and ask the user to generate a PIN (they die with the 401 error on the request for the "request token").
Please help. Thanks
I don't know if it will help you much with Android, but this post on Twitter OAuth by Chris Shiflett just came up on my interwebs.
First of all for OAuth you need to register your application with twitter I am assuming you have registered it. Now in case of desktop and mobile application you need request twitter for custom callback URL, as default callback url just works only for web apps. Once twitter approves requested call back URL , it will work .
But there is workaround, rather than OAuth request twitter for xAuth by submitting details of your applications. Then if twitter approves it , you can uses xAuth which works almost similar to OAuth.
Make sure your application had read&write access when you created it....
精彩评论