Base solution for your next web application
Open Closed

GetCurrentLoginInformationsAsync fails with IdentityServer #11397


User avatar
0
Ricavir created

ASP.NET CORE + Angular

Hi,

I have activated HangFire. I'm able to access to the Hangfire dashboard after login in from MVC page (from http://localhost:22742/ui/login) Everything works well without identityserver. But when I activate identityserver, I'm having an issue on UiController : when redirected to Index action, GetCurrentLoginInformationsAsync returns a null User. Therefore, I'm redirected to Login page...

Here is the code :

 [DisableAuditing]
    public async Task<IActionResult> Index()
    {
        var model = new HomePageModel
        {
            LoginInformation = await _sessionCache.GetCurrentLoginInformationsAsync(),
            IsMultiTenancyEnabled = _multiTenancyConfig.IsEnabled
        };
    
        if (model.LoginInformation?.User == null)
        {
            return RedirectToAction("Login");
        }
    
        return View(model);
    }

When identityserver is deactivated, the User information is not null...

I have configured IdentityServer the same as Zero.

Can you please provide some help ?


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

    Hi @Ricavir

    Could you create an issue on GitHub about this ? I tihnk the Host project's login page doesn't handle IDSRV enabled login.

  • User Avatar
    0
    Ricavir created

    Hi,

    Here is the issue : https://github.com/aspnetzero/aspnet-zero-core/issues/4667

  • User Avatar
    0
    ismcagdas created
    Support Team

    Thanks @Ricavir , we will work on this just after releasing 12.0 RC1 version.