Base solution for your next web application
Open Closed

LoginAsync is filtering on tenant. Bug? #68

apexdodge created

Hey there, I've run into a snag. I need to use multi-tenant and I'm trying to complete the login mechanism.

Here: <a class="postlink" href=""></a>

Here's the problem -- by default it seems that AbpSession.TenantId = 1. The TenantId is set to 1 even if you haven't logged in yet.

This is fine, but the problem is _userManager.LoginAsync appears to be filtering based on TenantId. I don't think this makes much sense. You can't filter on Tenant if the Tenant is set to 1.

I tested this by first being able to successfully login with a username and password if the user's TenantId was 1. I then changed the user's TenantId to 2 and I get InvalidUserNameOrEmailAddress.

Unless it's my responsibility to set the tenant session prior to running LoginAsync? That doesn't make sense either since I should only set the tenant upon a successful login.

LoginAsync should not filter on tenant in my opinion, unless I am doing something terribly wrong. Please let me know.


2 Answer(s)
  • 0
    apexdodge created

    Nope, my bad!

    For anyone who runs into a similar problem, you need to enable MultiTenancy in your WebModule file like this:

    <a class="postlink" href=""></a>

    Hope that helps.

  • 0
    hikalkan created
    Support Team

    In latest version of ABP, to enable multi-tenancy:

    Configuration.MultiTenancy.IsEnabled = true;

    This should be done in PreInitialize of your module.