Does using one registered app for two web apps only allow a user to login to one app at a time via EntraID?

Juwon Park 0 Reputation points
2024-12-05T20:22:14.7866667+00:00

I have two Blazor web app project: App1 & App2. Both of them are deployed to one Azure app service. App1 is deployed to root "/" and App2 is deployed to virtual application as "/app2".

I'm trying to use one app registration, so App1 and App2 will share the same registered app in Azure. However, this blocks user to login to App1 when the user is already logged in to App2 and vice versa. I'm using EntraID for user authentication.

Is there a way to allow user to login to both of the app at the same time?

Developer technologies | ASP.NET | ASP.NET Core
Developer technologies | .NET | Blazor
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,960 questions
Microsoft Security | Microsoft Entra | Microsoft Entra ID
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. brtrach-MSFT 17,741 Reputation points Microsoft Employee Moderator
    2024-12-06T00:26:06.24+00:00

    @Juwon Park Using a single app registration for multiple web apps can indeed cause issues with simultaneous logins due to how session cookies and tokens are managed. Here are a few strategies to address this:

    1. Single Sign-On (SSO): Ensure that both apps are configured to use Single Sign-On (SSO) with Microsoft Entra ID. This allows users to authenticate once and access both applications without needing to log in again
    2. Separate App Registrations: Consider creating separate app registrations for App1 and App2. This way, each app will have its own set of tokens and session cookies, preventing conflict.
    3. Token Sharing: If you prefer to use a single app registration, you might need to implement a mechanism to share tokens between the two applications. This can be complex and requires careful handling of security and token lifetimes
    4. Custom Authentication Logic: Implement custom authentication logic that can handle multiple sessions for the same user across different applications. This might involve custom middleware or modifications to how tokens are issued and validated

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.