Base solution for your next web application
Open Closed

User Email v User Name #8947


User avatar
0
eric_pulaski created

I've got a couple of questions around User Email/Name and Multi-Tenancy: (I plan to have a single DB with multiple tanants sharing the same DB, if that matters)

  1. I would like the user's email to be their "sign in" ID for my application, and I don't want a separate User Name. Is that easily workable with ASP.NET Zero, or does that not really work with ASP.NET Zero?

  2. I want the same user to be a member of multiple tenant orgarizations. Do User Names or Email addresses have to be unique across tenants? Can my user sign in once, and then pick their tenant from among the different Tenant companies that they are a member of? I really don't want to have separate logins each time they switch to a new Tenant. For example, I'm building a budget app. My users will invite their accoutants to their account. An accountant may have mulitple clients that are using my app. I want the accountant to login once, then pick the client (the Tenant) they want to get to. How do I manage that?

Thanks in advance for you help.

-Eric


1 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @eric_pulaski,

    1. You can just set the email address to user's username field when a user is created. A User is created on User List page and during user registration.
    2. A user can't belong to more than one tenant by default. However, for accountants, you can create user accounts on host side and allow them to impersonate specific Tenants, https://docs.aspnetzero.com/en/aspnet-core-angular/latest/Features-Angular-User-Management#user-impersonation.

    Do User Names or Email addresses have to be unique across tenants?

    No, same username can be used for different tenants. So, you can also create multiple users for an accountant for allowed tenants.