Endpoint contains authorization metadata, but a middleware was not found that supports authorization

In your Configure method, try this piece of code:

...
app.UseAuthentication();
app.UseRouting();
app.UseAuthorization();
app.UseEndpoints(endpoints =>
{
    endpoints.MapControllers();
});

Leave a Comment