Tiago Salgado

.NET / SQL Server / IT / etc...


News

My Stats

  • Posts - 37
  • Comments - 26
  • Trackbacks - 0

Twitter












Recent Comments


Recent Posts


Archives



One of the new features on Visual Studio 2012, is the ability to integrate a social login (Facebook, Twitter, etc) in our web applications. 
In this example, we can see how easy is to add Facebook login to our project. 
First, we need to create an App in Facebook Developers page. To do that, go to http://developers.facebook.com/apps and create a new one. 
After creating the app, we have something like this:
   
Now, go to VS2012, create a new project (i choose ASP.NET MVC 4 Web Application). Then, in Solution Explorer, you'll find a class in App_Start folder called AuthConfig.cs. 
Open it, and uncomment the following code:
 
OAuthWebSecurity.RegisterFacebookClient( 
 appId: "", 
 appSecret: ""
); 
 
 
Here, you need to add your appId and appSecret returned when you create the App on Facebook. And thats it. Try yourself and see how easy it is. This method is the same for ASP.NET Webforms, MVC. To WebPages, you need to uncommend the code in _AppStart.cshtml.

Comments

Gravatar # re: Facebook login in ASP.NET web application with Visual Studio 2012
Posted by Michael on 8/20/2012 1:21 PM
But users can login through Social Login by other providers like gmail, yahoo, hotmail , etc. So, I think, it's better to use Social Login one like developed by LoginRadius, http://www.loginradius.com. They also provide Social Sharing, Social Analytics. It’s also good plugin for Social Login.
Gravatar # re: Facebook login in ASP.NET web application with Visual Studio 2012
Posted by healthy home delivery Sydney on 8/25/2012 12:15 PM
I was struggling with this script for a long time. Finally I got it done following this steps. Great sharing. Thanks!
office catering sydney
Gravatar # re: Facebook login in ASP.NET web application with Visual Studio 2012
Posted by Tom on 8/29/2012 3:56 AM
Hi we're using 2012 and .net 4.5 and just started using oauth

I was just wondering with the Roles table that is created is there any way to get the roles hooked up using the asp.net configuration tool or do you have to manually write an admin page to add roles and add users to roles?

Cheers,
Tom
Gravatar # re: Facebook login in ASP.NET web application with Visual Studio 2012
Posted by Umer Qaisar on 2/11/2013 4:46 PM
hey can I create whole facebook apps using Visual Studio 2012 on asp.net// ..??
Have you ever ecpereinced../?
Gravatar # re: Facebook login in ASP.NET web application with Visual Studio 2012
Posted by JeyKeu on 4/7/2013 2:21 PM
Thanks,

But I wonder How do I write an app on fb platform using VS??
Post A Comment
Title:
Name:
Email:
Website:
Comment:
Verification: