dangtranduc / facebook-java-api

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

Incorrect signature #336

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I get incorrect signature when trying to use any method, can anyone please help 
me? I read somthing about set the application to "web mode" instead of 
"Desktop". But I don't know how to do that. Cant find any option for that in 
the application settings. The Key and Secret is correct.

Here is an example:

Filter:

..
..
logger.trace("Creating a FacebookWebappHelper, which copies fb_ request param 
data into the userClient");
FacebookWebappHelper<Document> webClient = new 
FacebookWebappHelper<Document>(request, response, getFacebookKey(), 
getFacebookSecret(), new FacebookXmlRestClient(getFacebookKey(), 
getFacebookSecret()));

FacebookXmlRestClient facebookClient = (FacebookXmlRestClient) 
webClient.getFacebookRestClient();
facebookClient.setIsDesktop(false);

setUserClient(facebookClient);
..
..

In java code in spring controller:

FacebookXmlRestClient client = 
FacebookSecurityFilter.getUserClient(request.getSession());

Document doc = client.events_get(client.users_getLoggedInUser(), null, 
System.currentTimeMillis(), null);

This is the logg:

<?xml version="1.0" encoding="UTF-8" standalone="no"?><auth_getSession_response 
xmlns="http://api.facebook.com/1.0/" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://api.facebook.com/1.0/ 
http://api.facebook.com/1.0/facebook.xsd"><session_key>1be08Xf26826Xa1d2X12569e-
1593830335</session_key><uid>15X38X0335</uid><expires>0</expires><secret>5fb72Xa
198X56db5X019974X9f36X4d4</secret></auth_getSession_response>
2010-09-17 01:02:32,176 INFO [se.hicom.security.FacebookSecurityFilter] - 
<sessionkey=1be087f26826aa1d2112569e-1593830335>
<?xml version="1.0" encoding="UTF-8" standalone="no"?><error_response 
xmlns="http://api.facebook.com/1.0/" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://api.facebook.com/1.0/ 
http://api.facebook.com/1.0/facebook.xsd"><error_code>104</error_code><error_msg
>Incorrect signature</error_msg><request_args 
list="true"><arg><key>api_key</key><value>d13ec3X067fX630c5X039feX7be1X0a7</valu
e></arg><arg><key>call_id</key><value>1284678152180</value></arg><arg><key>forma
t</key><value>xml</value></arg><arg><key>method</key><value>facebook.friends.get
</value></arg><arg><key>session_key</key><value>1be087f26826aa1d2112569e-1593830
335</value></arg><arg><key>sig</key><value>780eef4dX4129d0Xc1205eX447X3caf7</val
ue></arg><arg><key>uid</key><value>1593830335</value></arg><arg><key>v</key><val
ue>1.0</value></arg></request_args></error_response>
com.google.code.facebookapi.FacebookException: Incorrect signature
    at com.google.code.facebookapi.FacebookXmlRestClient.parseCallResult(FacebookXmlRestClient.java:217)
    at com.google.code.facebookapi.FacebookXmlRestClient.parseCallResult(FacebookXmlRestClient.java:72)
    at com.google.code.facebookapi.ExtensibleClient.callMethod(ExtensibleClient.java:529)
    at com.google.code.facebookapi.ExtensibleClient.callMethod(ExtensibleClient.java:451)
    at com.google.code.facebookapi.ExtensibleClient.friends_get(ExtensibleClient.java:820)

Thanks for any help!!

Original issue reported on code.google.com by mathias....@gmail.com on 16 Sep 2010 at 11:29

GoogleCodeExporter commented 9 years ago
I have tryied with both 2.0.5 and 3.0.2 version. Same result. Any help would be 
appreciated!

Original comment by mathias....@gmail.com on 16 Sep 2010 at 11:36

GoogleCodeExporter commented 9 years ago
I solved it be using latest version 3.0.5-SNAPSHOT

Original comment by mathias....@gmail.com on 19 Sep 2010 at 6:16