AD Group authorization in the MVC5 web application

It looked like a related answer, but instead I used the following syntax:

Ended up using [Authorize(Roles = "DOMAIN\\Group")] in the controller which worked perfectly

I have a web application that I have completed now, and the only thing you need to do is:

Upload to web server; Make the site accessible only to members of the AD group.

I read different articles and they all offer different things. I installed Windows authentication in MVC and prints the user ID on the banner as:

DOMAIN \ Username

All I want to do now is go through membership in the AD group. If the user is in a group, they can access the site; if they are not, they will not be able to view it.

I tried this in the web.config file, which I believe should work but is not in a test environment (VS 2013 Exp. For Web with iisexpress):

<authentication mode="Windows" />
<authorization>
  <deny users="?" />
  <allow roles="DOMAIN\Some Group"/>
</authorization>

Do I need a more complicated method? At the moment, I can still start and use the site, despite the fact that I was not in the specified AD group.

+4
source share
1 answer

Finished using [Authorize (Roles = "DOMAIN \ Group")] in the controller, which worked perfectly.

+1
source

All Articles