I have an ASP.NET WEB API Core 3.1 application working with Azure AD. I use Microsoft.Identity.Web library. I set up it like this:
public void ConfigureServices(IServiceCollection services)
{
Trace.TraceInformation("Configuring services");
services.AddProtectedWebApi(Configuration, subscribeToJwtBearerMiddlewareDiagnosticsEvents: true
)
.AddProtectedWebApiCallsProtectedWebApi(Configuration)
.AddInMemoryTokenCaches();
services.AddAuthentication(AzureADDefaults.BearerAuthenticationScheme)
.AddAzureADBearer(options => Configuration.Bind("AzureAd", options));
.......
}
My application is multi-tenant, so I need to cancel validating audience. Recently I've used the library as a separate project, so I could change it in its source code:
ValidateIssuer = false
but currently I use the library from nuget, so I can't simply change the source code to avoid validation of audience (issuer).
How should I configure the library to achieve it?