Base solution for your next web application
Open Closed

Change Tenant after login in #895


User avatar
1
duncanwilson created

Hello,

Is it possible to implement an action on the top of the page to let the user change Tenant?

Imagine that John Doe works in the morning for Tenant A and in the afternoon for Tenant B. Could we implement a feature (similar to the Host feature "Login as this tenant"), that would allow John Doe to change Tenant without having to Log out and Log in?

Best regards, Duncan p.s apologies for 2 posts, but I wasn't sure if I should or shouldn't separate the questions.


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

    Hi,

    We have implemented similar case in ASP.NET Zero. You can test it on <a class="postlink" href="http://demo.aspnetzero.com">http://demo.aspnetzero.com</a> or you can check the documentation <a class="postlink" href="http://aspnetzero.com/Documents/Development-Guide#linked-accounts">http://aspnetzero.com/Documents/Develop ... d-accounts</a>.

    Basically, there must be one user for each tenant or host. You must link users to each other, using a database table.

    For changing to another user, just logout current user and login target user.

    I hope this helps.

  • User Avatar
    0
    duncanwilson created

    Hello,

    First of all thank you very much for your response ismcagdas. Your linked accounts approach works indeed. Based on your answer can I correctly assume that "John Doe" needs to register in all the Tenants that his working for/with.

    An example:

    • John Doe register with Tenant A
    • Admin of Tenant A approves his access
    • John Doe register with Tenant B
    • Admin of Tenant B approves his access
    • John Doe can now link accounts -> and we can implement a dropdown to display the current Tenant his working on (logged in) and for him to be able to change accounts.

    Many thanks Duncan

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hello,

    Yes, in this solution "John Doe" needs to register in all the Tenants that he is working for/with :).

  • User Avatar
    0
    duncanwilson created

    That's it then, it covers the requirements :) Thank you ismcagdas really appreciated.

    Cheers Duncan