Example CK SDK for registering a user account in ASP.NET MVC 3

Is there a sample SDK for Facebook C # with ASP.NET MVC 3 (an application without a canvas) that:

  • Allows user to register through website registration form
  • Allows the user to log in via Facebook Connect and register the user if he first visited
  • Subsequently, allow the user to log in / authenticate through the login form or through Facebook (if the user has logged in via Facebook Connect).

It seems that this will be a common scenario that will benefit many others, but almost all the samples that I saw do not go beyond user authentication via Facebook. I think that a sample that can execute a basic login / registration script will help not digest the wheel.

Thank you very much!:)

+4
source share
1 answer

I am currently doing this on my website. However, keep in mind that the membership provider does not align correctly with FB Authentication. In my project, I have 2 controllers for FB authentication, and the other for forms authentication. The forms authentication code is pretty much the standard code introduced in the new project, except that I encrypt my password with BCrypt after adding the Salt value.

Please refer to my blog http://theocdcoder.com/tutorial-integrating-facebook-authentication-asp-net-mvc-3/ for FB integration. The reason I did not include another form code is because it is independent of the FB code.

Also, in the FB login method in the controller, you will have to process the script if the user has already registered through the Forms method, if then not create a new record for him.

Hope this helps.

+3
source

Source: https://habr.com/ru/post/1390005/


All Articles