Skip to content
This repository has been archived by the owner on Nov 19, 2021. It is now read-only.

Commit

Permalink
TFJ-377
Browse files Browse the repository at this point in the history
use of SSL is mandated for xAuth.
  • Loading branch information
yusuke authored and takawitter committed Aug 24, 2010
1 parent c16d758 commit 44a4e4b
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,13 @@ public AccessToken getOAuthAccessToken(RequestToken requestToken, String oauthVe
*/
public AccessToken getOAuthAccessToken(String screenName, String password) throws TwitterException {
try {
oauthToken = new AccessToken(http.post(conf.getOAuthAccessTokenURL(), new HttpParameter[]{
String url = conf.getOAuthAccessTokenURL();
if(0 == url.indexOf("http://")){
// SSL is required
// @see http://apiwiki.twitter.com/Twitter-REST-API-Method%3A-oauth-access_token-for-xAuth
url = "https://" + url.substring(7);
}
oauthToken = new AccessToken(http.post(url, new HttpParameter[]{
new HttpParameter("x_auth_username", screenName),
new HttpParameter("x_auth_password", password),
new HttpParameter("x_auth_mode", "client_auth")
Expand Down

0 comments on commit 44a4e4b

Please sign in to comment.