0

I can't get Oauth to work with Twitter. I have tried the following (all result in the same 401 error):

  1. jTwitter (using the default OauthSignpostClient)
  2. jTwitter using the commonshttp library (CommonsOauthProvider) instead of the "DefaultOauthProvider"
  3. jTwitter using the OauthScribeClient (instead of the OauthSignpostClient)
  4. oauth-signpost (by itself... no jTwitter)
  5. Twitter4J
  6. http://code.google.com/p/agirardello/
  7. http://dev.bostone.us/2009/07/16/android-oauth-twitter-updates/
  8. 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).

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

4

3 回答 3

0

我不知道它是否会对你的 Android 有很大帮助,但是Chris Shiflett 在 Twitter OAuth 上的这篇文章刚刚出现在我的互联网上。

于 2010-09-16T17:39:37.063 回答
0

首先,对于 OAuth,您需要在 twitter 上注册您的应用程序,我假设您已经注册了它。现在,在桌面和移动应用程序的情况下,您需要向 twitter 请求自定义回调 URL,因为默认回调 URL 仅适用于 Web 应用程序。一旦 twitter 批准了请求的回调 URL,它就会起作用。

但是有一种解决方法,而不是通过提交应用程序的详细信息来为 xAuth 请求 twitter。然后,如果 twitter 批准它,您可以使用与 OAuth 几乎相似的 xAuth。

于 2010-09-16T21:16:30.683 回答
0

确保您的应用程序在创建时具有读写访问权限......

于 2010-09-20T08:06:27.350 回答