Starts in:
2 DAYS
15 HRS
20 MIN
30 SEC
Starts in:
2 D
15 H
20 M
30 S
Open Closed

Admin user menu not showing on tiered app in dev / production, and logged in with same menu issue but not authenticated in production Azure deployment slots. #7716


User avatar
0
okains created
  • ABP Framework version: v8.2
  • 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:

I am working through a CI / CD implementation using Azure Deployment slots. I have a tiered application that I am trying to get deployed correctly. This is just a basic, no changes, out of the box 3 tier application generated by ABPSuite that I use as a base dev environment for testing.

First problem is that I can not see the full menu for the admin user in the tiered app on neither dev nor production. However in dev everything works as expected, I can create users, and I am authenticated as admin ( it seems ).

For reference, I created a single tier app, and I see the admin user menu as I would expect:

So I would expect to see this menu in my tiered app. They were created exactly the same time, same 8.2 version number, no code updates, just out of the box ABP. But I do not get the user / admin menu in my fresh and clean 3 tier app.

The real issue here is when I deploy a 3 tier app using Azure Deployment Slots to a staging environment on Azure. I can log in OK, and I get the same no options Admin menu as I got in my local dev environment:

However I can’t see any admin menu, and I get an Unauthorized exception after trying to do anything. Even though I seem to be logged in as the admin user.

After Refresh:

This to me seems like a configuration issue, but I can not seem to see any difference in config between environments.

Any insight would be much appreciated.

Thanks,

Karim Ainsworth


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

    hi

    Please test the new commits in your stage environment.

    https://github.com/Flo3Digital/Flo3BlazorDev/commits/master/

    Thanks.

  • User Avatar
    0
    okains created

    Hi,

    OK I had some difficulty with GitHub Actions there, took me some time to get deployed to staging but I have merged the code you added into Staging, redeployed and have emailed you all 3 DEBUG logs now.

    For some reason though, I don't see any of the JWTBearerOptions logging in the staging logs, similar to last time. And I cleaned out and reran this twice. However on dev I do see the logging:

    Thanks,

    Karim

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    I don't see any of the JWTBearerOptions logging in the staging logs,

    That's strange, We have to check the logs of staging apps.

    We need to make sure the configuration is correct.

    I have pushed the new commit. Can you try to deploy it again?

    Thanks.

  • User Avatar
    0
    okains created

    Hi,

    OK i have updated and redeployed. I ran this in dev and I can see the logging you are trying to do, but there are no values for the Bearer Token or Issuer. Could that be it?

    I still don't see anything in the deployed API logs, maybe you can see something, I have emailed both the DEV and STAGING API logs to you.

    Thanks,

    Karim

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    I still don't see anything in the deployed API logs

    This should be because you did not correctly deploy the latest code to the server.


    Your AuthServer:Authority in the staging environment is https://fbd-auth.azurewebsites.net

    I think this is the reason.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    I have updated the new code to help you to check your configuration.

    https://github.com/Flo3Digital/Flo3BlazorDev/commit/bc99a06899f4e60a1c7598ace3fd1cd27cf50e93

    [09:37:43 ERR] AuthServer:Authority: https://localhost:44362
    [09:37:43 ERR] JwtBearerOptions Authority: https://localhost:44362
    
    [09:37:43 ERR] JwtBearerOptions Issuer: https://localhost:44362/
    [09:37:43 ERR] JwtBearerOptions JwksUri: https://localhost:44362/.well-known/jwks
    [09:37:43 ERR] JwtBearerOptions ValidIssuers: https://localhost:44362/
    
  • User Avatar
    0
    okains created

    Hi,

    Ah yes, this was configured wrong:

    Your AuthServer:Authority in the staging environment is https://fbd-auth.azurewebsites.net

    I think this is the reason for the major errors on Staging. I have this configured correctly now, and also the new logging is working on the Staging environment. You can see now that I seem to be logged in as admin, and I can create a new Rock Star entity, so that is working.

    However, as per the original question, there is no menu on the Admin profile. This is also the case in the dev environment. I can email you the current logs, for this screenshot with the updated logging, maybe you can see something in there that would cause this problem?

    I see this in the Blazor App logs (FBD-STAGING), this looks like maybe why those menu items aren't showing, but how would those permissions not be set for the Admin user account?

    Thanks,

    Karim

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    This is also the case in the dev environment.

    Can I reproduce this with your Flo3BlazorDev project?

    If so, what are steps.

    Thanks

  • User Avatar
    0
    okains created

    Hi,

    Yes you can. Just log in with admin , default password. You should get to that exact screen, where it does look like we are logged in however no profile menu. Use the staging branch, it is exactly what is deployed now.

    Thanks,

    Karim

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    I have pushed the new commit. https://github.com/Flo3Digital/Flo3BlazorDev/commit/b349ece4729bbafa4b928a9c1e2d337d5ea94069

  • User Avatar
    0
    okains created

    Ah OK, that works, now the menu items are showing. However, when I click on My Account I am getting an exception thrown, also on Security Logs and Sessions, which seems like the same error from looking at the logs.

    Seems like the currentUser isn't being set, is there something else we are missing here?

    Thanks,

    Karim

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    https://github.com/Flo3Digital/Flo3BlazorDev/commit/65293d6c5f723f365858a037999d3448f13980af

  • User Avatar
    0
    okains created

    Hi,

    Thank you, this all works now. Thanks for sticking with this, it was a long one, I appreciate your help.

    Karim

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    Good news.

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