I would like to set the AddMicrosoftIdentityWebApp based on the request url (B2E, B2C) type to achieve authentication in Statup.cs

Amit Singh Rathore 0 Reputation points
2021-02-15T10:57:06.093+00:00

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

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,140 questions
.NET Runtime
.NET Runtime
.NET: Microsoft Technologies based on the .NET software framework.Runtime: An environment required to run apps that aren't compiled to machine language.
1,117 questions
0 comments No comments
{count} votes