0

I've added admin area to an existing MVC5 project for managing content.

The site is currently secured by custom ASP Identity Framework. Now I need to authenticate some employees to access the admin area, the employees user data is in different database with different structure similar to this question : Using multiple membership providers within ASP.Net MVC 3 application

Is this possible?

Community
  • 1
  • 1
tickwave
  • 3,335
  • 6
  • 41
  • 82
  • In what way is your ASP.NET Identity Framework custom? I think you'd be better off just adjusting your database model to meet your needs. – Brendan Green Jun 12 '15 at 02:32
  • It would be a lot of work to do, I simply need to not share the `User` property. For example, when checking if current user is logged in, I can simply do `User.Identity.IsAuthenticated`, so if I login on frontend and go to admin area, the `User.Identity.IsAuthenticated` will return `true`, that is why I need to separate them without using Claims etc because it will cause unnecessary complexity. – tickwave Jun 12 '15 at 02:38
  • Claims are baked right in, and are trivial to use. They are supposed in the `[Authorize]` attribute (which you could add to controllers in your admin area) or if you prefer to check other properties, see http://stackoverflow.com/questions/30554246/two-questions-about-mvc-and-identity/30566568#30566568 for an example. Multiple providers sounds to me like it would be **more** complex than using claims. – Brendan Green Jun 12 '15 at 02:46
  • Is `Role` functionality not suitable for you? – Yeldar Kurmangaliyev Jun 12 '15 at 03:30
  • @YeldarKurmangaliyev: No because they have different structure, I would rather split my admin area project to another solution. – tickwave Jun 12 '15 at 03:40

0 Answers0