Wednesday, July 16, 2014

Step by step how to login to your MVC site using Facebook Twitter Google+ or other social networks


In this tutorial we'll learn how to log in to your Asp.Net MVC site using Facebook Twitter Google+ or other social networksThe MVC Asp.Net allows us with a very little effort to enable the login through social networks like Facebook, entering some Web Site by means of Facebook authentication :


http://angularjsclub.blogspot.co.il/
http://angularjsclub.blogspot.co.il/



Because in this tutorial will be using Facebook, you need to create a Facebook App before. So go to the Facebook Developers page :

Then "Create New App" :


And link the App to your MVC project (remembering to update the LOCALHOST server to the real one after you deploy your application) :




After you create the New App, go to the Setting tab and copy-paste the App ID and the App Secret to the MVC application:

At the AuthConfig in the App_Start folder, un-comment the FacebookClient block:


And paste there the two codes:

Next rebuild your MVC project, to see that the LOGIN page has changed from the standard one :



To the upgraded one, with a Facebook button:



When you click it, you are requested to login through Facebook:




That's all!!  In this tutorial we've learned how to login to your Asp.Net MVC site using Facebook Twitter Google+ or other social networks.
Happy programming.....
        By Carmel Schvartzman
כתב: כרמל שוורצמן