Twitter4j 抛出 401 身份验证错误

发布于 2024-12-01 16:12:43 字数 1160 浏览 1 评论 0原文

当我尝试使用自己的凭据访问 Twitter 时,出现以下身份验证错误。有人能告诉我可能是什么问题吗?

401:身份验证凭据 (https://dev.twitter.com/docs/auth) 丢失或不正确。确保您已设置有效的消费者密钥/秘密、访问令牌/秘密以及同步的系统时钟。

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)

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)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

可是我不能没有你 2024-12-08 16:12:43
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.

通过设置适当的同步系统时钟解决了上述异常。

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.

彼岸花似海 2024-12-08 16:12:43

您是否在应用程序中提供了正确的消费者密钥和访问令牌?请阅读此处

Have you supplied correct consumer keys and access tokens in the application..? Read here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文