brockallen / BrockAllen.MembershipReboot

MembershipReboot is a user identity management and authentication library.
Other
742 stars 238 forks source link

How to move an account from one tenant to another #679

Closed pmbanugo closed 7 years ago

pmbanugo commented 8 years ago

How do I update a user account from one tenant to another? i.e move it from say tenant default to 'masters'

brockallen commented 8 years ago

well, i'd use the APIs to create a new account. the main issue is if there's already a user with the same username/email.

pmbanugo commented 8 years ago

yes there is a user with that name. it is just moving the user from one tenant to another. From what you're saying, I the solution should be: Delete and recreate the the user account to a different tenant?

brockallen commented 8 years ago

if there's already a user with the same name, do you know if it's the same person or a different person? is it safe to delete it?

pmbanugo commented 8 years ago

it's the same person. there are no users with the same name in the different tenants. It's just moving them to a diff tenant, basically, trying to change the tenant value in the db.

pmbanugo commented 8 years ago

I think it will be a tricky one as I need to know the users password. I don't want to pop-out a screen asking for password. I just want to silently move the user to a different tenant. What I can think of right now as a solution to my problem is just a simple query called in code that updates the value of the tenant column

brockallen commented 8 years ago

Ah right... well, you could just change the tenant column in the DB, but like I said, you need to make sure there is no other username/email.