Open
Description
Starting in .NET 7 Preview 7, we introduced new behavior in the authentication area in ASP.NET Core to reduce boilerplate and help build sensible defaults into ASP.NET Core.
Previously, users were always required to set the default authentication scheme that would be used by authentication and authorization handlers, like so:
builder.Services.AddAuthentication("MyDefaultScheme");
Moving forward, when (and only when) a single authentication scheme is registered, that scheme will be treated as the default scheme. For example, "foobar" will be treated as the default scheme in the code below.
builder.Services.AddAuthentication().AddOAuth("foobar");
This change might expose unintended behavior changes in applications, such as authentication options being validated earlier than expected.