© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•2y ago•
70 replies
abdesol

How to disable Microsoft Identity Web generated endpoints and redirection

So, in my project, I am trying to use microsoft identity for azure ad b2c configuration. But the problem is, it created its own endpoints, and now whenever I go to a non existing endpoint, it just chooses to redirect to the azure ad b2c provided remote url. It is weird what is going on. I only have it here in my asp.net webapi project:
builder.Services.Configure<OpenIdConnectOptions>(OpenIdConnectDefaults.AuthenticationScheme, options =>
{
    builder.Configuration.GetSection("AzureAdB2C").Bind(options);
    options.Scope.Add(options.ClientId!);
    options.SaveTokens = true;
});
builder.Services.AddAuthentication(OpenIdConnectDefaults.AuthenticationScheme)
    .AddMicrosoftIdentityWebApp(builder.Configuration.GetSection("AzureAdB2C"));
builder.Services.Configure<OpenIdConnectOptions>(OpenIdConnectDefaults.AuthenticationScheme, options =>
{
    builder.Configuration.GetSection("AzureAdB2C").Bind(options);
    options.Scope.Add(options.ClientId!);
    options.SaveTokens = true;
});
builder.Services.AddAuthentication(OpenIdConnectDefaults.AuthenticationScheme)
    .AddMicrosoftIdentityWebApp(builder.Configuration.GetSection("AzureAdB2C"));


Is there any obvious way I can remove the additional things created with it? I tried directly setting up open id connect.. but it still does the same thing. Thank you!
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements
Next page

Similar Threads

Microsoft Identity and web api
C#CC# / help
2y ago
Microsoft Identity migration
C#CC# / help
3y ago
How do i add Identity endpoints?
C#CC# / help
3y ago