Getting IdentityManager to make changes on two different databases

Viewed 217

We have two databases with User tables like below:

  • MasterDB.AspNetUsers
  • Customer1DB.AspNetUsers

We use MasterDb to log-in the users and then we connect them to a customer database, for example Customer1DB (or some other customer db depending on the user). Both user tables have identical schemas based on ASP.NET Identity Framework and we can use IdentityManager to manage users on MasterDb.

Now what I want is any changes performed on a MasterDb user record, mirror that to the users table on the customer's database (with same user Id). I was wondering what is the best way to do this? Do I need to modify all operations on UserStore, RoleStore, UserManager, RoleManager? I have a function that gets a UserId and adds or updates it from the first db to the second db, but I'm not sure how exactly I should integrate it in the Identity Framework implementations.

Thanks!

1 Answers
Related