Set specific controller to require role in ASP.NET Core 8 new authentication and authorization I use the new identity of ASP.NET Core 8: