Home > Blockchain >  MultiTenant Azure AppRegistration with Server Side Blazor
MultiTenant Azure AppRegistration with Server Side Blazor

Time:03-21

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):

enter image description here

In my appsettings.json file I am using the correct client & tenant id:

enter image description here

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 enter image description here

Please check your Domain value. You can find your domain here in your Azure AD overview page:

enter image description here

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.

References: Ref1, Ref2, Ref3

  • Related