huuanh1987 / facebook-java-api

Automatically exported from code.google.com/p/facebook-java-api
0 stars 0 forks source link

Problem in Login to Facebook #218

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Login to Facebook, Error Invalid parameter to authenticate and can not 
authenticate directly to the facebook page http: \ \ www.facebook.com \ 
login.php? "Api_key =" apikey + + "& v = 1.0 & auth_token =" + token); in 
the browser

What is the expected output? What do you see instead?
Correct the problem, update the API

What version of the product are you using? On what operating system?
facebook-java-api-2.1.2-SNAPSHOOT.jar

Please provide any additional information below.
already had a program that authenticates the facebook but now stopped 
working and gives an error invalid parameter.
Logged directly into the url also gives me error, that is?

Original issue reported on code.google.com by victo...@gmail.com on 19 Jun 2009 at 2:32

GoogleCodeExporter commented 8 years ago
Hi
I am facing the same problem from today morning.
Does anyone know how to solve the problem?

Original comment by amit.des...@gmail.com on 19 Jun 2009 at 2:20

GoogleCodeExporter commented 8 years ago
Hi all,
I got the issue in 2 days too.
My program work fine until yesterday. I can't figure what is happing :(
Who can help? thanks.

Original comment by thanh.ki...@gmail.com on 19 Jun 2009 at 5:22

GoogleCodeExporter commented 8 years ago
I also run into the same issue,  the following code are not working any more :
   public void connect(String login, String password) throws IOException,
FacebookException {
        System.out.println("Connecting");
        FacebookXmlRestClient client = new FacebookXmlRestClient(apiKey, secret);
        String token = client.auth_createToken();
        System.out.println("token = " + token);

        HttpClient http = new HttpClient();
        http.setParams(new HttpClientParams());
        http.setState(new HttpState());

        GetMethod get = new GetMethod(loginUrl + "?api_key=" + apiKey +
"&v=1.0&auth_token=" + token);

        http.executeMethod(get);

        Header responseCookieHeader    = get.getResponseHeader("Set-Cookie");
        HeaderElement[] cookieElements = responseCookieHeader.getElements();
        String cookieResponse = "";
        for (int i = 0; i < cookieElements.length; i++) {
            cookieResponse = cookieResponse + cookieElements[i].getName() + "=" +
cookieElements[i].getValue() + ";";
        }

        PostMethod post = new PostMethod(loginUrl);
        post.setRequestHeader("Cookie", cookieResponse);
        post.addParameter(new NameValuePair("api_key", apiKey));
        post.addParameter(new NameValuePair("v", "1.0"));
        post.addParameter(new NameValuePair("auth_token", token));
        post.addParameter(new NameValuePair("email", login));
        post.addParameter(new NameValuePair("pass", password));

        http.executeMethod(post);

        String session = client.auth_getSession(token);

        boolean b = client.users_setStatus("Testing new Java API");

        System.out.println("result = " + b);
    }

Original comment by yote...@gmail.com on 21 Jun 2009 at 9:00

GoogleCodeExporter commented 8 years ago
Yes, exactly, my code is similar to that which is left running for several days 
suddenly someone have any idea why?, The problem is in the API?, Or the problem 
is 
in Facebook?

Original comment by victo...@gmail.com on 21 Jun 2009 at 11:54

GoogleCodeExporter commented 8 years ago
hi all,
it's solved. please see the link.
http://forum.developers.facebook.com/viewtopic.php?pid=152609#p152609

Original comment by thanh.ki...@gmail.com on 22 Jun 2009 at 6:28

GoogleCodeExporter commented 8 years ago

Original comment by david.j....@googlemail.com on 22 Jun 2009 at 1:41