ASP.NET Core 3.1.1 Jwt redirects instead of returning http status 401 after migration from ASP.NET Core 2.2
问题 After migrating my website from .NET Core 2.2 to 3.1.1, my api endpoints suddenly started trying to redirect my api request to a default login page ( /Account/Login?ReturnUrl= , which I don't even have in any of my routes). My api is using a JWT bearer authentication scheme, with JWT Challenge Scheme, but still the redirect happened. services.AddAuthentication(options => { options.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme; options.DefaultScheme = JwtBearerDefaults