fdt 3.1 beta + mvc + fbml = not working

May 29, 2010 at 12:01 AM

Hi all, I've read everything I could find about this but have not been able to locate a clear, direct explanation for how to address the following:


Configuration details:


(Under Migrations) new data permissions = off

FBML app

decorated my HomeController with [FacebookAuthorization(IsFbml = true, ApiKey = APIKEY, Secret = SECRET)]

specified app key, secret, suffic, and callback url in web.config


Problem description:

I am logged into fb and have already authorized my app to use my personal info.  I browse to the root page for the app on fb, and end up at a url with an auth_token appended to it.  I have attempted to do this:

   Api api1 = this.GetApi(APIKEY, SECRET);
   var user1 = api1.Users.GetLoggedInUser();
   return Content("Hello, " + user1.ToString());

which returns this error:

   at Facebook.Utility.Utilities.ParseException(String response, Boolean JSONFormat)
   at Facebook.Rest.RestBase.processResponse(WebResponse webResponse, Boolean useJson)
   at Facebook.Rest.RestBase.SendRequestSynchronous(IDictionary`2 parameterDictionary, Boolean useSession, Boolean useJson)
   at Facebook.Rest.RestBase.SendRequest[T](IDictionary`2 parameterDictionary, Boolean useSession, Boolean useJson)
   at Facebook.Rest.RestBase.SendRequest[T](IDictionary`2 parameterDictionary, Boolean useSession)
   at Facebook.Rest.Auth.GetSession(String auth_token, Boolean isAsync, GetSessionCallback callback, Object state)
   at Facebook.Session.CanvasSession.LoadFromRequest()
   at Facebook.Session.FBMLCanvasSession..ctor(String appKey, String appSecret)
   at Facebook.Web.Mvc.ControllerExtension.GetApi(Controller controller, String apiKey, String secret)
   at Yearbook_Builder.Controllers.HomeController.Index() in C:\Projects\FBSample\Controllers\HomeController.cs:line 34

Additionally, when I click on another tab, although the auth_token query parameter disappears (why I am not sure, as I was getting all kinds of crazy redirect errors before - perhaps upgrading to 3.1 beta fixed it), I still can't get access to the api.  I get exactly the same error as above.

Can anyone explicitly tell me how to correct this?  Thanks very much!


Jun 1, 2010 at 7:51 PM
No one has any idea about this?
Jun 1, 2010 at 9:01 PM

Just try this: [FacebookAuthorization(IsFbml = true)]  it will get the api key and secret form the config.  Also always good to step in with debugger and see where it might be breaking.  sometimes this helps me catch wether or not i remembered to put correct things in config file.


Jun 2, 2010 at 5:21 PM


In the "Migrations" section in the Developer app, what do your settings for New Data Permissions and New SDKs look like?  I had to disable both in order to get the sample MVC app to work, and my symptoms were the same as yours.  This was before June 1 though, when Facebook started enforcing some permissions changes.


Jun 2, 2010 at 5:23 PM

Sorry, I now see that you already mentioned your New Data Permissions setting.  Try disabling New SDKs though, if that's currently enabled.


Jun 2, 2010 at 8:15 PM

agreed, my experience is FDT is not compatible with the "New SDKs" migration setting.