-
Notifications
You must be signed in to change notification settings - Fork 249
Description
Which version of Microsoft Identity Web are you using?
0.2.3-preview
Where is the issue?
I'm trying to make my ASP.NET Core Web API compatible with both AAD tokens issued on behalf of applications as well as AAD B2C tokens issued on behalf of users, but run into errors when trying to configure both entries in my appsettings.json file. If I only initialize AddMicrosoftWebApi once, then I get issues verifying JWT signature when the token is generated using the identity provider that was left out.
Is this a new or an existing app?
c. This is a new app
Repro
services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
.AddMicrosoftWebApi(this.Configuration, "AzureAd")
.AddMicrosoftWebApi(this.Configuration, "AzureAdB2C")Expected behavior
ASP.NET Core app is setup to validate tokens issued from both identity providers.
Actual behavior
Error during startup: InvalidOperationException: 'Scheme already exists: Bearer'