开发者

Facebook C# SDK cannot resolve FB Login

I'm developing an MVC-2 application with Facebook C# SDK and recently Facebook stopped to respond to my login requests. After some research, I've managed to get it working by putting 'localhost' in the 'Site Domain' field in facebook application settings.

Now, login through Facebook Javascript SDK seems to be working alright, but the Facebook C# SDK always returns the FacebookApp.Sessio开发者_开发知识库n value as null. To be sure that this issue is not because of some configuration or development mistakes, I've even tried the sample application from Facebook C# SDK website, but no luck.

Any suggestions on this issue?

Thanks.


Did you start with the sample application? If you start with that it should just work out of the box. I am guessing you have cookie support set to false in the web.config setting. http://facebooksdk.codeplex.com/releases/view/54371#DownloadId=160969 Your web.config file should look like this:

  <configSections>
    <section name="facebookSettings" type="Facebook.FacebookConfigurationSection"/>

  </configSections>

  <facebookSettings
        apiKey="your_api_key" 
        apiSecret="your_api_secret" 
        appId="your_app_id" 
        cookieSupport="true" />

Also, make sure you are using the released version and not the latest source code. The source code is not for production use and has some bugs that will make it hard for you to learn the toolkit.


I've tried to work with this library, but imho wasn't that much fun. For the Facebook Application you have to enter a static port number and your Visual Studio build in IIS have to run on this port, too.

For example:

http://localhost:55555/

If you've got enough time, try to take a look at https://github.com/prabirshrestha/FacebookSharp. It comes with a build in FacebookController for ASP.net MVC. Works great for me :-)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜