Customize security with copied AspNetUsers tables

If I have two types of users in a db, users and customers and need a separate application or login for both.
I like the built in security, so if I use AspNetUsers for my users I would like to copy the AspNetUsers etc tables, give them other names and then use them for customers
Would this be easily doable?

Hi @kolaval,

This won't be an easy task (if at all possible). I don't think you can run two separate instances of Asp.Net Identity that use different backends (tables). I would use different roles for users and customers if I were you.

Would it be easier if I created two projects?
It would still require a separate set of user tables in the database though.

It would probably be easier however we haven't done it. One needs to create a new IdentityDbContext from scratch that maps to the new tables. You can check the documentation. Be prepared that this isn't an easy task.

seems like a solution would be to scaffold the identity so you can override defaults and use the aspUserID to a junction table for userType then use roles to open what is needed for each unless i am missing something.

1 Like