简体   繁体   中英

Android Twitter4j 401 Authentication error

I'm using the AndroidTwitter project at https://github.com/lorensiuswlt/AndroidTwitter to connect to Twitter and send a tweet. I can authorize with Twitter successfully, and it says I'm logged in, however when I go to post a tweet, I get this error. The system time is correct on the Android device, and my oauth key and secret are filled out (No problems when logging in).

08-01 14:25:07.222: W/System.err(5527): 401:Authentication credentials (https://dev.twitter.com/docs/auth) were missing or incorrect. Ensure that you have set valid consumer key/secret, access token/secret, and the system clock is in sync.
08-01 14:25:07.222: W/System.err(5527): error - Could not authenticate with OAuth.
08-01 14:25:07.222: W/System.err(5527): request - /1/statuses/update.json
08-01 14:25:07.222: W/System.err(5527): Relevant discussions can be found on the Internet at:
08-01 14:25:07.222: W/System.err(5527):     http://www.google.co.jp/search?q=b2b52c28 or
08-01 14:25:07.222: W/System.err(5527):     http://www.google.co.jp/search?q=1a591522
08-01 14:25:07.222: W/System.err(5527): TwitterException{exceptionCode=[b2b52c28-1a591522],     statusCode=401, retryAfter=-1, rateLimitStatus=null, featureSpecificRateLimitStatus=null, version=3.0.0-SNAPSHOT(build: a5aafcad15add0fbc7a6583e337a1abbafa23435)}
08-01 14:25:07.229: W/System.err(5527):     at twitter4j.internal.http.HttpClientImpl.request(HttpClientImpl.java:176)
08-01 14:25:07.229: W/System.err(5527):     at twitter4j.internal.http.HttpClientWrapper.request(HttpClientWrapper.java:61)
08-01 14:25:07.229: W/System.err(5527):     at twitter4j.internal.http.HttpClientWrapper.post(HttpClientWrapper.java:98)
08-01 14:25:07.229: W/System.err(5527):     at twitter4j.TwitterImpl.post(TwitterImpl.java:1970)
08-01 14:25:07.237: W/System.err(5527):     at twitter4j.TwitterImpl.updateStatus(TwitterImpl.java:415)
08-01 14:25:07.237: W/System.err(5527):     at net.londatiga.android.TwitterApp.updateStatus(TwitterApp.java:106)
08-01 14:25:07.237: W/System.err(5527):     at net.londatiga.android.TestPost$5.run(TestPost.java:106)

If you've just set it up, your twitter app is probably still set to read-only. Check your app's application type in the twitter settings console. Make sure you re-generate your access tokens after changes.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM