gpt4 book ai didi

spring-boot - 访问 Twitter 数据 - 使用有效凭据进行身份验证失败

转载 作者:行者123 更新时间:2023-12-01 18:57:36 33 4
gpt4 key购买 nike

我已经从 Spring 的入门指南 - 访问 Twitter 数据 https://spring.io/guides/gs/accessing-twitter/ 下载了代码。 .

我在 application.properties 中设置了我的凭据,没有进行其他更改。我运行该应用程序,当它尝试连接到 Twitter 时,它失败并在 ConnectController 第 240 行出现异常:

ResourceAccessException: org.springframework.web.client.ResourceAccessException: I/O error on POST request for "https://api.twitter.com/oauth/request_token":cannot retry due to server authentication, in streaming mode; nested exception is java.net.HttpRetryException: cannot retry due to server authentication, in streaming mode

我已检查应用程序是否正在读取凭据。它们是有效的 - 我使用它们来连接我用 twitter4j 编写的另一个应用程序,尽管在这种情况下,除了消费者 key 和消费者 secret 之外,我还使用 token 和 token secret 。

有什么想法吗?

谢谢

最佳答案

我遇到了与您完全相同的问题:发生这种情况是因为我没有在 Twitter 设置中设置回调 URL。

只需检查您的 Twitter 应用程序设置中是否已设置回调字段(我使用与网站字段相同的 URL)。

关于spring-boot - 访问 Twitter 数据 - 使用有效凭据进行身份验证失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30952411/

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com