Bind multiple entries to Microsoft Identity Web Api

95 Views Asked by At

I am using Microsoft Identity Web api for my authorization and I am binding to an entry in my appsettings. Is it possible to bind to 2 entries as i use Azure AD & AzureADB2C as both intranet & internet application uses these APIs.

.AddMicrosoftIdentityWebApi(options =>
{
    Configuration.Bind("AzureAd", options);
    options.Events = new JwtBearerEvents();
    options.SaveToken = true;
}
1

There are 1 best solutions below

0
bolt-io On

Yes, this is possible - this guide has all of the details: MIW: Multiple Authentication Schemes

If you are concerned about the complexity of implementing two identity providers, you can also federated Microsoft Entra ID (formerly Azure AD) in Azure AD B2C and only connect your application to Azure AD B2C. Details here: Set up sign-in for a specific Azure Active Directory organization in Azure Active Directory B2C