简体   繁体   中英

C# MVC 4 multiple login systems

I'm creating a site that has 3 logical areas where people need to log in:

  1. customers login
  2. companies login
  3. admin/business manager login

I'm trying to work out the best way to handle the logins.

Is it possible to use the identity model with 3 different login pages, 3 different tables etc and keep them all separate? If so how do I go about this?

Or do I need to just handle this via roles, although the data needed to be held will be vastly different and they will already have several roles on each of the 3 systems?

I'm using C# MVC 4, .Net 4.5, Wntity framework 5. Any comments or thoughts welcome as I'm struggling to get my head around on how to do it.

Has anyone implemented something similar?

Thanks.

I've never done this myself, but you might want to try using the "path" parameter on the forms authentication config value to specify a separate cookie for each area.

http://msdn.microsoft.com/en-us/library/vstudio/1d3t3c61%28v=vs.90%29.aspx

This article has a section on partitioning a site which may be useful: http://msdn.microsoft.com/en-us/library/ff648341.aspx

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM