简体   繁体   中英

MVC3 C# Facebook Login Integration

I am trying to create an MVC3 C# simple application that uses facebook to login based on the following tutorial:

http://facebooksdk.codeplex.com/wikipage?title=Getting%20Started%20with%20an%20ASP.NET%20MVC%203%20Website

I have setup an application in facebook with the following settings:

  1. Wesite with facebook login chosen
  2. Url for website: http://localhost:14568/ <-- 14568 is the same port number I have setup in VS2010 for the project.
  3. I have added my appId and appSecret that I receive from facebook to my webconfig file as show in the tutorial.

When I run my application and click on my facebook login icon, it redirects me to facebook, I then login to facebook, choose don't save device. After this step I get the following error in facebook:

An error may have occurred as part of the login process. You can close this window and try returning to the application, though it may ask you to login again. This is likely due to a bug in the application.

I have followed the tutorial exactly but get this error, I have noticed in the tutorial, seting up the aplication in facebook looks different. Is there something I am missing?

It seems you have to register in facebook the URL to the page, accessible from internet. As far as you use http://localhost:<portnumber> the facebook API has no access to your page.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM