Dotnet open auth with Facebook and Email/Password login with aspnet_membership tables

207 views Asked by At

I'm building my first mobile app in which users can login. My app talks to webservices on my site's backend.
Users can login/register via either

  1. Facebook or
  2. an email/password combination

In both cases (upon registration) I add user data to the aspnet_membership tables, in case of a Facebook registration the only extra thing is that I also store the Facebook Id.

Now, I want to use DotNetOpenAuth to facilitate the login and registration process. But obviously I need to alter some code for the logic that creates/retrieves data from aspnet_membership database tables.

Is this possible and if so, does anyone have code samples?

1

There are 1 answers

1
Win On BEST ANSWER

First of all, you should not alter aspnet_membership table. If so, underlying store procedures will stop working.

Instead, you want to create a new table with UserId as primary key, and make one-to-one relationship with aspnet_membership table.

FYI: the ASP .Net Membership Provider you are using is more than 10 years old, and not actively developing anymore.

If you are developing a new project, you should consider using new ASP.Net Identity which support Facebook Login out of the box.