Twitter4J 访问令牌已经可用 [英] Twitter4J Access token already available
问题描述
我在使用 Twitter4J 时收到错误消息:
I am receiving error messages while working with Twitter4J:
java.lang.IllegalStateException: Access token already available.
twitter4j.auth.OAuthAuthorization.getOAuthRequestToken(OAuthAuthorization.java:112)
twitter4j.auth.OAuthAuthorization.getOAuthRequestToken(OAuthAuthorization.java:104)
twitter4j.TwitterBaseImpl.getOAuthRequestToken(TwitterBaseImpl.java:276)
twitter4j.TwitterBaseImpl.getOAuthRequestToken(TwitterBaseImpl.java:269)
[...]
调用方法Twitter.getOAuthRequestToken()
时抛出此异常.我想获取授权 URL 以对下一个用户进行身份验证.
This exception is thrown while calling the method Twitter.getOAuthRequestToken()
. I want to get the Authorization URL to authenticate the next user.
我该如何解决这个问题?我只将 OAuthConsumerKey、OAuthConsumerSecret、OAuthAccessToken 和 OAuthAccessTokenSecret 放入 Twitter4J 属性.但是如何接收授权 URL 以对新用户进行身份验证?
How am I possible to solve this problem? I only put the OAuthConsumerKey, the OAuthConsumerSecret, the OAuthAccessToken and the OAuthAccessTokenSecret to the Twitter4J properties. But how do I receive the authorization URL to authenticate a new user?
谢谢和问候,
马丁
推荐答案
抱歉.
我正在设置一个由配置生成器硬编码的访问令牌.
I was setting an Access Token hard coded by the Configuration Builder.
已删除,现在可以使用了.
Removed it, works now.
这篇关于Twitter4J 访问令牌已经可用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!