0

I have MVC application with Forms authentication, that runs on IIS 7.5. It runs OK in debug enviroment and also after deployment on serwer but ONLY when is called from the server directly (http://127.0.0.1). When I try to run it from the remote computer the logon screen is not displayed, I recievie HTTP Error 401.0 - Unauthorized You do not have permission to view this directory or page. Similar application with the same logon (forms) runs OK on the same server.

Piotr
  • 11
  • 1
  • Could you please have a look at my answer on [ASP MVC in IIS 7 results in: HTTP Error 403.14 - Forbidden](http://stackoverflow.com/questions/1741439/asp-mvc-in-iis-7-results-in-http-error-403-14-forbidden/41363973#41363973). – Murat Yıldız Dec 28 '16 at 14:25

1 Answers1

0

After three days of googling and strugling it turned out that the view with logon page contained the partial wiew with standard page footer and there was @Html.RenderAction("...","..") call in this footer. The called action contained [Authorize] attribute. After wrapping this call with if(Request.IsAuthenticated) everything works OK. Quite strange - when the page was called by localhost addres, some part of footer just did not show without making this error. To sum up - in case of 401.0 after deployment the problem could be in application's view.

Piotr
  • 11
  • 1