I would like to set the AddMicrosoftIdentityWebApp based on the request url (B2E, B2C) type to achieve authentication in Statup.cs
he code we are trying in ConfigureServices(IServiceCollection services) method in Statup.cs
//Based on request type the code should pick the configuration needed services.AddAuthentication(OpenIdConnectDefaults.AuthenticationScheme).AddMicrosoftIdentityWebApp(Configuration.GetSection("AzureAdB2E")) // AzureAdB2E is config settings in appsettings.json eg:"Instance,Domain,ClientId" etc..Services.AddAuthentication(OpenIdConnectDefaults.AuthenticationScheme) // AzureAdB2E is config settings in appsettings.json eg:"Instance,Domain,ClientId" etc..AddMicrosoftIdentityWebApp(Configuration.GetSection("AzureAdB2C"));
The Error
Name Value Type
Message "Scheme already exists: Cookies" string