mspnp / AzureNamingTool

The Azure Naming Tool is a .NET 8 Blazor application, with a RESTful API. The UI consists of several pages to allow the configuration and generation of Azure Resource names. The API provides a programmatic interface for the functionality.
https://aka.ms/azurenamingtool
MIT License
308 stars 604 forks source link

Unable to switch between "Global admin" and AAD authenticated user. #51

Closed knuterik-ballestad closed 7 months ago

knuterik-ballestad commented 7 months ago

Tool version 3.2.0

Describe the bug ANT configured with Authentication: -I am able to access ANT as a EntraID domain user, and the app showing me as logged in. -When I then log out, I am also able to log in as Global admin -When logging out as global admin, it is no longer possible to re-authenticate as EntraID domain user.

To Reproduce Steps to reproduce the behavior:

  1. Enter ANT, login is OK and automatic
  2. Click on 'Log out'
  3. Log in as "Global admin" with special password
  4. Log out from global admin role

Expected behavior I expect to then be able to re-login as domain user, but this is not possible

Screenshots Before logging out from global admin image

After logging out from global admin image

Workaround:

Installation Method Clickops-install as container app

BryanSoltis commented 7 months ago

Hello @knuterik-ballestad,

The Azure Naming Tool identifies an authenticated user by looking at the headers injected into the request. When running the tool in an Azure Entra-protected App Service, Azure Entra will inject specific headers for the user. The Azure Naming Tool reads these headers and determines that you are authenticated.

When you log out and back in as the Admin, you are still in the same "session" for the tool. Currently, the tool does not attempt to log you back in as the authenticated user. You will need to close the tab and open a new one to initiate the authentication process again.

We will evaluate having the tool "re-autheticate" users and may add it in a future release.

Thank you!

-Bryan