Open Closed

Tenant Impersonation login back issue #9360


User avatar
0
sourav created

I'm encountering an issue related to impersonation in our multi-tenant application. When I impersonate a tenant user from the host admin account and then attempt to switch back to the host admin, the system automatically logs me out. I have to manually click the login button to reauthenticate as the host admin.

This behavior seems unintended, as I expect to return to the host session seamlessly after ending the impersonation.

I’ve attached a video demonstrating the issue. Has anyone else faced this? Any suggestions or recommended fixes would be appreciated. DOWNLOAD THE VIDEO https://drive.google.com/file/d/1EQBKG6MHoEv3MP8UprrPCQ0TNU1RRLhc/view?usp=drive_link


3 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Can you share the authserver project logs?

    https://abp.io/support/questions/8622/How-to-enable-Debug-logs-for-troubleshoot-problems

    and the HTTP request and response of Angular.

    https://abp.io/support/questions/8622/How-to-enable-Debug-logs-for-troubleshoot-problems#answer-3a1a1c4b-691e-3403-98b9-5f23fa024759

    liming.ma@volosoft.com

    Thanks

  • User Avatar
    0
    sourav created

    We are encountering this issue after deployment. It works fine in the local environment. Although the issue does not occur every time, it happens most of the time. I'm sending you the mail with logs.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Can you try to upgrade to >=9.1.1

    Or try to add MyAbpEfCoreNavigationHelper to your EF Core project.

    using Microsoft.EntityFrameworkCore.ChangeTracking;
    using Volo.Abp.DependencyInjection;
    using Volo.Abp.EntityFrameworkCore.ChangeTrackers;
    using Volo.Abp.OpenIddict.Tokens;
    
    namespace Pusula.Training.HealthCare.EntityFrameworkCore;
    
    [Dependency(ReplaceServices = true)]
    [ExposeServices(typeof(AbpEfCoreNavigationHelper))]
    public class MyAbpEfCoreNavigationHelper : AbpEfCoreNavigationHelper
    {
        public override void ChangeTracker_Tracked(object? sender, EntityTrackedEventArgs e)
        {
            if (e.Entry.Entity.GetType() == typeof(OpenIddictToken))
            {
                return;
            }
    
            base.ChangeTracker_Tracked(sender, e);
        }
    
        public override void ChangeTracker_StateChanged(object? sender, EntityStateChangedEventArgs e)
        {
            if (e.Entry.Entity.GetType() == typeof(OpenIddictToken))
            {
                return;
            }
    
            base.ChangeTracker_StateChanged(sender, e);
        }
    }
    
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v9.3.0-preview. Updated on June 13, 2025, 11:37