开发者

ASP.NET MVC login page returns 401 (unauthorized access) after publishing to hosting provider

In order to provide secure access to开发者_运维百科 some administrative backend for a very restricted group of users I used forms based authentication to some secured controller actions. In my case web.config contains something like:

<authentication mode="Forms">
  <forms loginUrl="~/User/Login" timeout="2880">
    <credentials passwordFormat="SHA1">
       <user name="some-user" password="fb223245bd5488866347724c2c95dbe4bb5ac906"/>
    </credentials>
  </forms>
</authentication>

As I don't need membership providers and the user is hard coded, membership (and roles) is not configured.

This worked fine in my development environment (VS2010 + integrated web server) until I published the site to the hosting provider. Now everytime I navigate to the User/Login action the server returns errorcode 401 - unauthorized access.

Any idea how to solve this problem? Are there any IIS configuration issues?

Hosting Environment: * IIS 7 * .NET 4.0 / ASP.NET 4.0 MVC2 enabled

thanks in advance, Reinhard


See this answer on ServerFault, and this related blog post.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜