I'm using the default Blazor Server Template in Visual Studio 2022 with the authentication set to use the Microsoft Identity Platform.
I have an AppRegistration in my Azure Active Directory account set to allow accounts in any organization (Multitenant):
In my appsettings.json file I am using the correct client & tenant id:
When I run the application I can log in with any account that is in my AAD tenant (or has been invited into my AAD). However when I try to use an identity from another AAD Tenant I get the following error:
Selected user account does not exist in tenant 'TENANT NAME' and cannot access the application 'APP-REGISTRATION-ID' in that tenant. The account needs to be added as an external user in the tenant first. Please use a different account.
From what I have found in the docs and other articles I need to be using the common endpoint for logging in, but if I change the "Domain" in my appsettings to "common" it does not make a difference and if I update "Instance" to
Please check your Domain
value. You can find your domain here in your Azure AD overview page:
Make sure to include CallbackPath
from your appsettings.json file in Redirect URI of your application to avoid redirect URI mismatch error.
Please find below references if they are helpful.