Reputation: 71
Is there a sample of the Facebook C# SDK with ASP.NET MVC 3 (non-canvas application) that:
It seems like this would be a common scenario that would benefit many others, but virtually all the samples I've seen do not go beyond authenticating the user with Facebook. I'm thinking a sample that can perform the basic login/registration scenario would help in not having to re-invent the wheel.
Many thanks! :)
Upvotes: 4
Views: 4129
Reputation: 5891
I am currently doing this on my website. However note that the Membership provider does not align properly with FB Authentication. In my project I have 2 controllers one for FB authentication and the other one is for Forms authentication. The Forms Authentication code is pretty much the standard one provided in a new project except that I am encrypting my password with BCrypt after adding a Salt value.
Please refer to my blog http://theocdcoder.com/tutorial-integrating-facebook-authentication-asp-net-mvc-3/ for the FB integration. The reason I didn't include the other Forms code is that it is independent of FB code.
Also in the FB login method in the Controller, you will have to handle the scenario if the user was already registered through Forms method if not then create a new record for the same.
I hope it helps.
Upvotes: 3