Home > OS >  Enable authorization for root path in ASP.NET Core
Enable authorization for root path in ASP.NET Core

Time:10-30

I have ASP.NET Core application with authorization and it works just fine. But The authorization does not work for the root path of my application.

Here is example (authorization works, because we have [Authorize] attribute above an endpoint:

www.example.com/cars

Here is what I need to authorize also but it doesn't work:

www.example.com

CodePudding user response:

I made this possible by the [Route] attribute above a default action.

  • Related