Need help getting MVC sample to run

May 28, 2010 at 3:06 AM

I'm trying to get Kevin Marshall's MVC sample to run.  On controllers with the [FacebookAuthorization] attribute, Facebook displays this error:

Received HTTP error code 500 while loading http://fb.example.com/?auth_token=<auth-token>

I'm puzzled about which controller actually handles the postback and receives auth_token.  Any help would be appreciated.

 

May 28, 2010 at 2:38 PM

Which release of the FDT are you using?  And are you using the new FB permissions ("Migrations" settings on your app settings in FB) or the old?  Iframe or FBML app?

I think there are some problems with the latest FDT source and the new permissions API, as I described here:  http://facebooktoolkit.codeplex.com/Thread/View.aspx?ThreadId=213954

For now I am sticking with the older toolkit and old permissions API, because I have them working pretty smoothly with my Iframe MVC app.

What's up with the "fb.example.com" in your 500 error message?  Is that for real?  You shouldn't be using example.com but you probably know that I am guessing.

May 28, 2010 at 5:46 PM
patja wrote:

Which release of the FDT are you using?  And are you using the new FB permissions ("Migrations" settings on your app settings in FB) or the old?  Iframe or FBML app?  What's up with the "fb.example.com" in your 500 error message?  Is that for real?  You shouldn't be using example.com but you probably know that I am guessing.

 Hello,

I have tried both 3.0.2 and 3.1-beta.  I have also tried both FBML and iframe apps.  When using an iframe app, my canvas URL is http://localhost/.  When using an FBML app, the URL points to my hosting provider.  I only used www.example.com as an example.  I also have disabled the new FB permissions.

Should the above settings work?  Of course, I substitute the real URL instead of example.com.

 

May 28, 2010 at 9:46 PM

That all looks right to me, except I'm not sure about the statement "When using an iframe app, my canvas URL is http://localhost/. "  Your canvas callback URL needs to be an internet-accessible fully qualified domain name like http://fb.example.com/ .   Facebook can't get at localhost. 

I only do Iframe, so can't help with FBML.  But I can attest to the fact that the FDT will work with an MVC Iframe app based loosely on the Kevin Marshall sample, because I've been running one for months.  Works on my localhost with a DynDNS domain DNS-mapped to my Comcast IP address with port-fwding port 80 to my dev box, and on my hosted server.

May 29, 2010 at 12:04 AM
patja wrote: But I can attest to the fact that the FDT will work with an MVC Iframe app based loosely on the Kevin Marshall sample, because I've been running one for months.  Works on my localhost with a DynDNS domain DNS-mapped to my Comcast IP address with port-fwding port 80 to my dev box, and on my hosted server.

 I only have "Secret" and "ApiKey" in my <appSettings> in Web.config.  Do I need anything else such as the callback URL?

 

May 29, 2010 at 12:56 AM

Curiously, I have better luck when I deploy in Azure.  I seem to be able to authenticate then, and at least read the first name of the current user.  I don't have any luck with the non-Azure version.  I guess this means I don't have IIS configured correctly?  Maybe my hosting provider is rewriting URLs or something.