1

I'm developing a ASP.NET MVC webapplication currently running on IIS Express (for development).

The webapplication has two pages

  • Computer
  • Department

General authentication settings in web.config

<system.web>
  <authentication mode="Windows" />
  <authorization>
    <allow users="*" />
  </authorization>
  </roleManager>
</system.web>

The DeparmentController enforces authentication using the authorize attribute:
[Authorize(Roles = @"DOMAIN\Administrators")]

When visiting the computer page unauthorized, all content loads fine.

content load success

When visiting the department page, I'm prompted to enter my credentials. The authentication works as expected, but I get '500 Internal Server Error' on css, js and ico files.

content load error

During my research, I only found the exact same problem the other way around. Where the static files where not loaded for unauthorized users.

samvdst
  • 618
  • 7
  • 22

1 Answers1

0

Did you implement windows authorization within iis as well, also does your user have permission to the directories that the page is displaying?

Vee
  • 428
  • 4
  • 11
  • Isn't this enabled by default in IIS Express? Authenitication works. Only loading of static content gives errors. Admin user should have access to all files because of web.config – samvdst Jan 25 '17 at 18:49
  • Missed the bit on iisexpress – Vee Jan 25 '17 at 18:59
  • Could the following help – Vee Jan 25 '17 at 19:07
  • http://stackoverflow.com/questions/24499220/why-is-iis-express-returning-http-500-errors-loading-javascript-and-css – Vee Jan 25 '17 at 19:07
  • I deleted the `.vs` folder as well as the `IISExpress` folder under Documents and restarted Visual Studio -> Did **not** solve the problem. – samvdst Jan 25 '17 at 19:37