API.Data.CreateObjectAsync generates Exception

Dec 21, 2009 at 4:22 PM
Edited Dec 21, 2009 at 5:09 PM

How do I use the method:

API.Data.CreateObjectAsync(...)

It generates the following error in the event handler:
"Facebook.Utility.FacebookException: This method call must be signed with the application secret (You are probably calling a secure method using a session secret)"

How do I set the Secret key? When I create my browser session in Silverlight with:

Session = new BrowserSession(MyAppKey);

I don't get the option to enter my secret key.

 

 

 

 

Dec 21, 2009 at 11:28 PM
Edited Dec 21, 2009 at 11:29 PM

If you use BrowserSession then you expected to call Login() method at some point. Until you do so you are not going to be able to call secure methods of Facebook API.

Check out this link for a bit more info: http://msdn.microsoft.com/en-us/windows/ee395718.aspx

Dec 22, 2009 at 6:05 AM

I actually call the login method like this:

            BrowserSession Session = new BrowserSession(MyAppKey);
            Session.Login();

I wait for the login to complete and then try to Call API.Data.CreateObjectAsync(...)

The problem seems to be that I somehow need to provide my secret app key, but I don't know how I do that.

 

 

 

Dec 22, 2009 at 7:44 AM
Edited Dec 22, 2009 at 7:46 AM

Now I understand. Data.CreateObject is one of the methods that can not be signed using session secret (http://wiki.developers.facebook.com/index.php/Session_Secret_and_API_Methods).  You can try to set application secret directly: Session.ApplicationSecret = ... or use different Session type. For example CanvasSession constructor takes appKey and appSecret as parameters. Without knowing more about your situation in is hard to be more specific.

Dec 23, 2009 at 9:55 AM

OK, thanks!

I'll try to create ASP.Net Webservice that make these calls, and then reference the Webservice from my Silverlight app.

Mar 19, 2010 at 1:35 AM

I'm getting the same exception. I'm doing this in a desktop application (Winforms 3.5) calling:

facebookService1.Data.CreateObjectType("cow");

and I get:

This method call must be signed with the application secret (You are probably calling a secure method using a session secret)

How can one do this correctly from a desktop app?

Thanks...

-Ben

Apr 25, 2010 at 1:03 AM

I read on the Facebook developer's Wiki that they are only allowing getUserPreference and setUserPreference from desktop apps.

http://wiki.developers.facebook.com/index.php/Data_Store_API_documentation

Apr 29, 2010 at 6:19 PM

Thanks for the info!

 

-Ben