2

I'm hosting a Blazor Wasm site which has multiple domain names, using Azure B2C I need to navigate to the right Azure B2C branded policy. Is there a way to change configuration depending on the URL.

Or if there's a way I can dynamically change the signInPolicy during log in, which will mean changing a few more configuration settings.

Here's an example of what I'm trying to achieve

var builder = WebApplication.CreateBuilder(args);

if(URL == "Brand1.com")
{
    builder.Services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme).AddMicrosoftIdentityWebApi(builder.Configuration.GetSection("AzureAd_Brand1"));
}
else
{
    builder.Services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
    .AddMicrosoftIdentityWebApi(builder.Configuration.GetSection("AzureAd_Brand2"));
}

It's a blazor wasm app which is ASP.Net hosted.

Thanks in advance

Rav
  • 703
  • 4
  • 13

0 Answers0