eyhan / facebook-java-api

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

Invalid parameter exception on client.auth_getSession() #219

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Create a "Desktop" Facebook application and get its api key and secret.
2. Use this key and secret to use any of the FacebookXXXRestClient.
3. Call client.auth_createToken() then login to the facebook with this 
token and API key.
4. Call client.auth_getSession(token).

What is the expected output? What do you see instead?
The method should return the session key. Instead we get this exception:

com.google.code.facebookapi.FacebookException: Invalid parameter
    at 
com.google.code.facebookapi.FacebookXmlRestClient.parseCallResult
(FacebookXmlRestClient.java:220)
    at 
com.google.code.facebookapi.FacebookXmlRestClient.parseCallResult
(FacebookXmlRestClient.java:72)
    at com.google.code.facebookapi.ExtensibleClient.callMethod
(ExtensibleClient.java:535)
    at com.google.code.facebookapi.ExtensibleClient.callMethod
(ExtensibleClient.java:472)
    at 
com.google.code.facebookapi.FacebookXmlRestClient.auth_getSession
(FacebookXmlRestClient.java:196)

What version of the product are you using? On what operating system?
2.1.1 on Windows XP.

Please provide any additional information below.
Thi issue is also reproducible when you run any of the unit tests that 
call client.auth_getSession(). e.g. Issue140FriendsGetJSONTest, 
Issue161FriendsGetSessionless or Issue179SessionSecretAndDesktop.

Original issue reported on code.google.com by nabeelmukhtar on 24 Jun 2009 at 6:54

GoogleCodeExporter commented 8 years ago
This may be related to a change in the way facebook authenticates tokens:
http://forum.developers.facebook.com/viewtopic.php?pid=152308

I had the same problem until I read the forum, and added some code in my app to 
parse
the non_user_id_enc param value from the login GET response and add it as a 
parameter
to the login POST request.

It appears lots of other people ran into the same issue and the workaround 
worked for
them, and interestingly the moderator posts a message saying that the flow has 
not
changed, his apps work fine, and that using http client is a violation of 
facebook
TOS and policies.

Original comment by phillip....@gmail.com on 25 Jun 2009 at 9:26

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
i have to use your code but at present show Invalid Parameter

how to use product version and operating System.
i have to use facebook-java-api-1.8-final and windows7 
please solve my problem

you have to contact me on "kkpande25@gmail.com"
thanks  

Original comment by kkpand...@gmail.com on 4 Jun 2010 at 11:38