1
votes

I have an mvc website that is using the asp.net membership database.

I am wanting to enhance the website to allow users to use their facebook details to log into my site.

I use the database for membership and role management, I have a number of other related tables based on the userid created when a new user is added.

I want to be able to allow users to use facebook to login however I still need all the features of the standard membership provider.

I have hooked in the facebook api and im getting everything I need like name,facebook id and age.

I want to develop something that can be reused as some type of helper.

Do I

  1. Create a new class and inherit from the MembershipProvider
  2. Create my own insert methods using the data from facebook to create the new account within my new membership provider
  3. Use the facebook Id as the username
  4. Create a final registration page to capture anything that facebook doesnt provide to populate the other required tables.

If I create this membership provider in a seperate project (so I can reuse) can I use the entity framework to do all of my inserts and edits? I know I have to reference the database's name however what if I want to use this .dll again in another project where the database name is different.

Thanks for any suggestions

1
V interested to see the responses to this since FB connect + Gmail login are now expected by site users (Microsoft has sadly neglected ASP.NET Membership) . Have you looked at the preview of Web Pages 2 which introduces OAuth/OpenID login (asp.net/web-pages/overview/what's-new/…) but not sure if it will integrate with Membership...Judo

1 Answers

0
votes

If you use this dll in any project, just put a connectionstring in your webconfig and when you access db through EF or any other provider just past it or write code in your DLL to access that from your webconfig. its working fine.

Its same as if have created three saperate project in a solution like BLL, DLL and PL, in this case your DLL is added as Dll in you PL and its use your PL WebConfig connectionstring to create connection with you DB.