Twitter4j throws 401 authentication errors
I am getting the following authentication error when trying to access Twitter using my own credentials. Can someone tell what the problem could be?
401:Authentication credentials (https://dev.twitter.com/docs/auth) were missing or incorrect. Ensure that you have set valid conumer key/secret, access token/secret, and the system clock in in sync.
Tests run: 6, Failures: 0, Errors: 5, Skipped: 0, Time elapsed: 4.953 sec <<< FAILURE!
showStatusTes开发者_开发问答t(com.mycompany.twitter.test.TwitterClientTest) Time elapsed: 0.672 sec <<< ERROR!
401:Authentication credentials (https://dev.twitter.com/docs/auth) were missing or incorrect. Ensure that you have set valid conumer key/secret, access token/secret, and the system clock in in sync.
TwitterException{exceptionCode=[6b80c41c-1bd1da85], statusCode=401, retryAfter=-1, rateLimitStatus=null, featureSpecificRateLimitStatus=null, version=2.2.5-SNAPSHOT(build: 5f9c44cd0e0c1972f8d17653a226b9b6a3392ac2)}
at twitter4j.internal.http.HttpClientImpl.request(HttpClientImpl.java:185)
at twitter4j.internal.http.HttpClientWrapper.request(HttpClientWrapper.java:65)
at twitter4j.internal.http.HttpClientWrapper.get(HttpClientWrapper.java:93)
at twitter4j.TwitterImpl.get(TwitterImpl.java:1869)
at twitter4j.TwitterImpl.showStatus(TwitterImpl.java:445)
401:Authentication credentials (https://dev.twitter.com/docs/auth) were missing or incorrect. Ensure that you have set valid conumer key/secret, access token/secret, and the system clock in in sync.
The above exception was solved by setting the appropriate system clock in sync
.
Have you supplied correct consumer keys and access tokens in the application..? Read here
精彩评论