1

I want to restrict the application to be accessed by one particular AD Group only. So I have implemented authorize attribute on the controllers and web.config as below. But the application is now not accessible to everyone including the AD group. Could anyone please help.

[Authorize(Roles = @"Domain\ADGroup")]
    public class HomeController : Controller


  <authentication mode="Windows" />
        <authorization>
          <deny users="?" />
        </authorization>
        <roleManager enabled="true" defaultProvider="AspNetWindowsTokenRoleProvider">
          <providers>
            <clear />
            <add name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider" applicationName="/" />
          </providers>
        </roleManager>

I have also tried the response given in the post Authorization using active directory role provider MVC4 as below but that doesn't seem to have resolved. I am still getting the 401 unauthorised error

[Authorize(Roles = "Domain\\ADGroup")]
public class HomeController : Controller
ChinnaR
  • 797
  • 3
  • 9
  • 24
  • Possible duplicate of [Authorization using active directory role provider MVC4](https://stackoverflow.com/questions/20707758/authorization-using-active-directory-role-provider-mvc4) – ste-fu Aug 21 '17 at 09:25
  • I have tried the link you mentioned but that doesn't seem to have resolved. I have also tried the authorize attribute to each action method but I still get the 401 Unauthorised error – ChinnaR Aug 21 '17 at 09:54

0 Answers0