Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I tried to log into my Facebook account with these lines that I read from an answer to a question already posted, but I can't log in anyway! I looking for some tips to correct the code:

Connection.Response res = Jsoup.connect("https://www.facebook.com/login.php")
    .data("email", "mymail", "pass", "mypas")
    .method(Method.POST)
    .execute();

    System.out.println(res.statusCode());
    Document doc = res.parse();
    String sessionId = res.cookie("SESSIONID");

PS: No i don't want to use Facebook APIs!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
593 views
Welcome To Ask or Share your Answers For Others

1 Answer

There are a bunch other parameters that are passed in the request:

lsd:AVptuGRS
email:***
pass:***
default_persistent:0
timezone:-120
lgnrnd:043627_eQnN
lgnjs:1383914188
locale:en_US

And dont forget about referer parameter. Facebook may ganerate some sort of one-time token for login request to prevent bypassing of Facebook API.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...