Base solution for your next web application
Open Closed

Multitenant Mixed Authentication #11347


User avatar
0
mahendra created

Hello Expert,

We are using multitenant core+angular verion of ASPNetZero. We have few tenants and the application running successfully.

We have a new requirement now. we need to know whether it is possible even or not. ok so here is the requirement.

Let's say we have a tenant called A, B, C and D. When we browse the page with (tenant) subdomain as A, B or C it should run as it is, i.e. login page should be visible. But when I browse the page with (tenant) subdomain as D it should run the complete site without asking for login. It should pull all the tenant data (i.e. D tenant) without login.

In short one of the tenant should run anonymously.

If you can throw some light on the above requirement possibility, I can try walking that path.

Thanks & Regards, Mahendra


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

    Hi @mahendra

    The easiest solution comes to my mind is, you can define a user for such Tenants (for example admin user which exist for all tenants) and automatically login admin user of Tenant D (or such tenants). In that case, all operations will work as expected.

    Otherwise, you will face problems like app will try to set CreationUserId, LastModifierUserId of many entities and it will fail.

  • User Avatar
    0
    mahendra created

    Hi @mahendra

    The easiest solution comes to my mind is, you can define a user for such Tenants (for example admin user which exist for all tenants) and automatically login admin user of Tenant D (or such tenants). In that case, all operations will work as expected.

    Otherwise, you will face problems like app will try to set CreationUserId, LastModifierUserId of many entities and it will fail.

    We have a self registration mechanism for tenant registration. Saying so, when to create such a user? I can't create such user during tenant registration. Because once tenant is registered, then after that tenant purchsa an additional feature (scan and pay - Scan the bar code at the table in the resturant). Once user purchase this feature then only I need such a requirement.

    On a second thought, can i use user impersonation by login into host account and then impesonating the admin user of the tenant?

    Regards, Mahendra

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @mahendra

    On a second thought, can i use user impersonation by login into host account and then impesonating the admin user of the tenant?

    You can use that for sure.

    Saying so, when to create such a user? I can't create such user during tenant registration. Because once tenant is registered, then after that tenant purchsa an additional feature (scan and pay - Scan the bar code at the table in the resturant). Once user purchase this feature then only I need such a requirement.

    admin user is created automatically when a tenant registers to the system but you can create such a user for any tenant whenever you want.