twitter4j XAuth认证 [英] twitter4j xAuth authentication
问题描述
我试图用twitter4j库整合XAuth认证
I'm trying to integrate xauth authentication using the twitter4j library
我发现类似 HTTP多个指南:// WWW。 hiteshagrawal.com/java/twitter-xauth-permission-using-java 所有指示我应该有一行:
I've found multiple guides similar to http://www.hiteshagrawal.com/java/twitter-xauth-permission-using-java that all indicate i should have the line:
Twitter twitter = new TwitterFactory().getInstance(username, password);
但是,这给了我一个错误,因为getInstance()方法不允许两个字符串的参数。
But this gives me an error, because the getInstance() method doesn't allow the parameter of two strings.
做了twitter4j库的变化,还是我做错了什么?
Did the twitter4j library change, or am I doing something wrong?
推荐答案
微博德precated基本身份验证和Twitter4J 2.2.0,你需要使用Twitter#getOAuthAccessToken(ID,密码),以获得访问令牌。
http://twitter4j.org/en/versions.html#migration21x-22x
Twitter deprecated Basic authentication and as of Twitter4J 2.2.0, you need to use Twitter#getOAuthAccessToken(id,password) to get the access token. http://twitter4j.org/en/versions.html#migration21x-22x
这篇关于twitter4j XAuth认证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!