Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to implement social login in asp.net mvc 4?

I want to implement role based login using oauth with facebook, twitter, google etc. It will only be using oauth and will have a role system. Not the default template with the usual registration and login. Seems like dot net open auth will help withe initial stuff, but i can find no good example of using or extending it. Can someone explain how to use dotnet open auth from scratch and how to get extra info with it?

like image 381
Sakibul Alam Avatar asked Jan 27 '13 17:01

Sakibul Alam


People also ask

What is OAuth authentication in ASP NET MVC?

OAuth provides client applications a "secure delegated access" to server resources on behalf of a resource owner. It specifies a process for resource owners to authorize third-party access to their server resources without sharing their credentials (from the Wikipedia). OAuth stands for Open Authorization.

What is AuthConfig Cs in MVC?

When you create an MVC 4 web application with the Internet Application template, the project is created with a file named AuthConfig. cs in the App_Start folder. The AuthConfig file contains code to register clients for external authentication providers.


1 Answers

  1. Launch Visual Studio 2012
  2. Create a new ASP.NET MVC 4 application using the Internet Template
  3. Open the ~/App_Start/AuthConfig.cs file
  4. Uncomment the providers you want to use by putting your client key and secret for the corresponding provider

For more information about OAuth integration I invite you to head to the DotNetOpenAuth site, go through the documentation, download and play with the samples.

like image 188
Darin Dimitrov Avatar answered Sep 23 '22 01:09

Darin Dimitrov