API.Data.CreateObjectAsync generates Exception

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

How do I use the method:


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 22, 2009 at 12:28 AM
Edited Dec 22, 2009 at 12:29 AM

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 7:05 AM

I actually call the login method like this:

            BrowserSession Session = new BrowserSession(MyAppKey);

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 8:44 AM
Edited Dec 22, 2009 at 8: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 10: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 2:35 AM

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


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?



Apr 25, 2010 at 2:03 AM

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


Apr 29, 2010 at 7:19 PM

Thanks for the info!