0

I have recently upgraded my MVC3 application to MVC4 successfully. In my old MVC3 application, I had a custom membership provider written to read/write user details, into custom tables within a Sql Server database. The upgraded MVC4 application works perfectly well with the custom membership provider.

I now want to allow my users to login through Active Directory and/or social media (including facebook and google). My question is: What would be the best way to accomplish this? Should I scrap my old custom membership provider and write a new one that implements SimpleMembershipProvider instead? Or is there another more efficient, better way to accomplish this?

I still need to keep my custom tables, since it holds required user/role information and is also referenced by other tables in my application for user-specific data.

Thank You

SimpleUser
  • 1,341
  • 2
  • 16
  • 36

1 Answers1

1

I think you will find it difficult to mold SimpleMembership to fit your existing membership database and it is being deprecated for ASP.NET Identity. If you are going through the upgrade process now keep going to MVC 5 and use ASP.NET Identity. It is much more extensible in it's architecture and support OAuth with plugins for the major social media sites.

Kevin Junghans
  • 17,475
  • 4
  • 45
  • 62
  • Hi Kevin,thank you for your comment. Been reading your blog posts about this. My main issue seems to be SimpleMembership doesn't support Guid keys for the user table. And since it is not supported in MVC5, it seems a waste of time to create a workaround custom version for now. I'm looking at what is involved in moving to MVC 5, how easy it is and any breaking changes I should be aware of, esp to do with membership. – SimpleUser Feb 12 '14 at 14:01
  • Actually ASP.NET Identity can be customized to use Guid keys. Check out this QA. http://stackoverflow.com/questions/19912049/need-to-change-asp-net-identity-rtm-user-id-from-nvarchar128-to-uniqueidenti – Kevin Junghans Feb 12 '14 at 14:48
  • Can I ask Kevin, have you upgraded to MVC5? Do you suggest it or should I probably wait until they have resolved any early issues with it? – SimpleUser Feb 12 '14 at 15:14
  • 1
    I have upgraded to MVC5 and overall I am happy with it. The problem with ASP.NET Identity is that there is little documentation at this time and since it is a 1.0.0 release there is a lot of flux. The 2.00 beta is available now with a final release this spring. I will admit that I am a bit of a risk taker and like to be on the bleeding edge. You will have to way the risk of a newer version against spending the effort to migrate to a version that is already behind. Take a look at the new features introduced in MVC5, Web API 2, and ASP.NET Identity and see if you will benefit going forward. – Kevin Junghans Feb 12 '14 at 15:29