Search code examples
c#asp.net-mvcasp.net-mvc-4asp.net-membership

MVC 4 Change Application Name of Membership provider


I am using the default setup for MVC 4 project.

I have 2 projects, one for a shop front and another for an admin area. I want to specify the application name of each of these to be different so I can log into my admin area and shopfront independently even though both must run from the same database.

Ideally, I want to keep on using the simple membership provider.

Can this be done?


Solution

  • SimpleMembership doesn't have application name like regular Membership Provider.

    However, you can store all users in same database, and restrict access by roles.

    In other words, those who login to/access Admin site must have admin role assigned.