When I create a new .net project, the startup.cs automatically gets the following code line:
app.UseAuthorization();
Without app.UseAuthentication(), what purpose does the above line serve?
With app usе сommands are activated or added so-called middleware through which the http request passes before reaching its end point (controller method, page handler ...), these middleware can be global or decorate pieces of code in the form of attributes. In this case, user authorization activates the authorization for the application and its attributes. You can read more about here: https://docs.microsoft.com/en-us/aspnet/core/fundamentals/middleware/?view=aspnetcore-6.0