In this ASP.NET MVC 3 intranet application (created using the Intranet Application MVC 3 application template), where users are automatically authenticated against AD, I try to restrict access to the controller to users in the local Administrators group. To do this, I tried applying AuthorizeAttribute like this:
[Authorize(Roles = "Administrators")] public class ElmahController : Controller
However, although my AD user (the application reports that the expected user has been authenticated) is in the local Administrators group, I cannot access the controller when AuthorizeAttribute is applied. Only a blank page appears. What am I doing wrong?
On the other hand, I checked that specifying my specific user is working:
[Authorize(Users = @"ad\arve")] public class ElmahController : Controller
In this case, I can get a page with limited access.
EDIT: I found that the response to the group with BUILTIN worked:
[Authorize(Roles = @"BUILTIN\Administrators")]
Is this the ultimate way to access local groups through AuthorizeAttribute though ??
source share