Starts in:
2 DAYS
16 HRS
34 MIN
0 SEC
Starts in:
2 D
16 H
34 M
0 S
Open Closed

Losing Authentication after a few seconds in Production #7904


User avatar
0
okains created
  • ABP Framework version: v8.2.3
  • UI Type: Blazor Server
  • Database System: EF Core (SQL Server)
  • Tiered (for MVC) or Auth Server Separated (for Angular): yes
  • Exception message and full stack trace:
  • Steps to reproduce the issue:

Hi,

This just started to happen, when I log in to our production (test) environment everything is OK for a few seconds, then I seem to be losing authentication, and getting an 'Unauthorized' exception when calling a service method on the homepage. I have a video of this here:

https://drive.google.com/file/d/1xJpaKd_RJFRgb90Ol0IxINk0oW9c6n6Y/view?usp=drive_link

I have detailed errors on so I can see the exception in the browser console:

Do you know why / how this is happening and how to fix?

Thanks,

Karim Ainsworth


43 Answer(s)
  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    Can I check remotely?

  • User Avatar
    0
    okains created

    Hi,

    Yes of course, anything you need to do. Though this is deployed to an Azure App Service x 3, Auth / API / Blazor, and that is where I am having the problems. Let me know what you need from me and I will provide to you.

    Thanks,

    Karim

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    We can have a meeting to check it, I'm live in UTC8 and my work time is 9am to 6pm, let me know what time good for you

    It's better if you can provide a simple project with me to reproduce the problem , so I can check it deeply and get back to you.

  • User Avatar
    0
    okains created

    Hi,

    I am in UTC + 6.5, free for the next few hours if you want to send a meeting link. We could try at 12pm my time , 1:30pm your time if that works?

    This only occurs in a production environment, locally everything is fine. May be helpful to run through the code though to see if there is anything obvious that could be causing this.

    Thanks,

    Karim

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    We could try at 12pm my time , 1:30pm your time if that works? This only occurs in a production environment, locally everything is fine. May be helpful to run through the code though to see if there is anything obvious that could be causing this.

    okay, no problem

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    There is the link https://us05web.zoom.us/j/5929668302?pwd=UXl2M2RUeG5PazVSY2ZCOW1NMUxtZz09

  • User Avatar
    0
    okains created

    ok

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    I think the problem is you are using the webapp template but change the mode to Interactiveserver , so there will be some unexpected problems.

    I made some changes(sorry for take too long time, because the network latency is very high), but I'm not sure it will work, you can get a try and back to me.

  • User Avatar
    0
    okains created

    OK great, yeah I wasn't sure if you could hear me during the ZOOM call. I was following what you did, makes sense. Let me test this out locally, then deploy to our test environment and I will let you know how it goes.

  • User Avatar
    0
    okains created

    Hi,

    Unfortunately, same AbpRemoteCallException. Ran everything locally, worked fine. I think probably removing the WebAssembly code is the right thing to do, it could cause other problems but unfortunately it didn't help with this one:

    Volo.Abp.Http.Client.AbpRemoteCallException: Unauthorized , what is the root cause of this exception ( other than obviously not being properly logged in ) , is there any way to dig into this and determine what we need to look at a bit more closer?

    Thanks,

    Kariom

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    Can you share an admin account/password with me?

  • User Avatar
    0
    okains created

    Hi,

    Sure, what is your email address?

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    shiwei.liang@volosoft.com

  • User Avatar
    0
    okains created

    Hi,

    OK I have sent credentials to that email.

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    You can try change Interactiveserver to InteractiveAuto to temporarily solve this problem. Or create a new same name project with BlazorServer UI to replace your existing project and copy your code.

    I will keep researching this problem.

  • User Avatar
    0
    okains created

    Hi,

    This project was using InteractiveAuto initially, but I was having issues even in development with Authentication. I had created a support ticket for that 3 months ago that you and I went through, the solution was to change to InteractiveServer mode.

    I just did try and go back to InteractiveAuto earlier today, but got some different auth related exceptions in development so I have moved it back.

    Or create a new same name project with BlazorServer UI to replace your existing project and copy your code.

    This could knock me back a month, we have been working through various issues and it feels like we are so close. Everything is working fine in development, there is just this Auth exception in the test environment.

    Any other suggestions on how to focus and fix that particular issue would be great, really need to get past this so that I can continue working on this project.

    Thanks,

    Karim

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    Can you add the following code and re-deploy project and share the result.

    public partial class Index
    {
        [Inject]
        public IAbpAccessTokenProvider AbpAccessTokenProvider { get; set; }
    
        [Inject]
        public IRemoteServiceHttpClientAuthenticator ServiceHttpClientAuthenticator { get; set; }
    
        public string Token { get; set; }
    
        protected async override Task OnInitializedAsync()
        {
    
            Token = await AbpAccessTokenProvider.GetTokenAsync();
    
        }
    }
    
    <h3>AccessTokenProvder Type is : @AbpAccessTokenProvider.GetType().FullName</h3>
    
    <h3>ServiceHttpClientAuthenticator Type is @ServiceHttpClientAuthenticator.GetType().FullName</h3>
    
    <h3>Current token @Token</h3>
    
  • User Avatar
    0
    okains created

    Hi,

    This was a problem with my WebSockets config on Azure. I had set it correctly initially, so I didn't think to go back and check that setting. I spent some time over the weekend going over every single config setting and I found that it was not set correctly. Once I set it, then everything is working fine.

    I really do appreciate your help and your patience with this one, I think some of the changes we made will make things more stable also so that is a good thing.

    Will close this now. Thanks again for your support.

    Karim

Made with ❤️ on ABP v9.1.0-preview. Updated on November 20, 2024, 13:06