Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Twitter4j throws 401 authentication errors

Tags:

twitter4j

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!
showStatusTest(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)
like image 965
diya Avatar asked Dec 05 '25 01:12

diya


1 Answers

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.

like image 193
diya Avatar answered Dec 07 '25 13:12

diya



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!