Role base authentication with custom error with role name in dot net 6 – Asp.net
I use the below the line for role based authentication at top of methods in controllers [HttpGet("getAll"), Authorize(Roles = "GetAll")] When a user doesn't have access to this role, I want to tell the user that you need the role…