授权问题、FormsAuth 和 ASP.NET MVC
我有一个非常简单的 ASP.NET MVC 站点应用程序。 (MVC 1.0)
我的 web.config 中没有授权部分,因为我在控制器上使用 [Authoize] 属性。
正如预期的那样,服务器的默认 web.config 允许 * 进行表单身份验证。
我有 2 台现有的 Windows 2008 专用(托管)服务器。 该网站运作良好。
我有一个新的专用服务器,看起来相同,只是该网站无法工作。 每个资源,甚至图像/javascript 都会重定向到登录页面。
我尝试添加显式授权规则以允许 * 和位置规则,结果相同。 我检查了 .NET 信任级别:内部/完全信任。 一切都在两台服务器上完美运行,只是这一台忽略了所有授权规则。
有任何想法吗? 谢谢
I have a pretty simple ASP.NET MVC Site Application. (MVC 1.0)
I have NO authorization sections in my web.config because I use the [Authoize] attribute on my controllers.
The default web.config for the server allows * for forms authentication, as expected.
I have 2 existing Windows 2008 dedicated (hosted) servers. The site works well.
I have a new dedicated server, seems identical except the site just won't work. Every resource, even images/javascript is redirecting to the login page.
I tried adding explicit authorization rules to allow * and location rules, same result. I checked the .NET Trust level, Internal/Full Trust. Everything runs perfectly on two servers, just this one is ignoring all rules for authorization.
Any ideas?
thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我发现了这个问题:) 除非 Windows 2008 中发生了某些变化,否则我本以为这会显示为错误,但如上所述,它被表单身份验证隐藏了。
问题是托管公司现在将数据驱动器添加到您网站/存储的所有服务器上。 没有设置允许 IIS 读取文件的权限。 我找不到它的原因是我已经添加了应用程序池用户的权限,在我的例子中,我只是继续添加 ASPNET、网络服务、IIS 匿名用户等以获得完全权限。
我需要允许每个人至少读取网站文件夹,然后 IIS 显示不安全的内容。 我仍然认为形成 auth 很奇怪。 正在启动并忽略所有 web.config 规则,但无论如何。
我通过在 IIS 7 管理器中关闭 Forms Auth 支持发现了该错误。 然后我因为文件权限而收到进程失败错误。
I found the issue :) Unless something has changed in Windows 2008 I would have expected this to show as an error but as stated above, it was being hidden by Forms Authentication.
The issue was the hosting company now adds data drives to all servers for your websites/storage. There were no permissions set to allow IIS to read the files. The reason I couldn't find it was I already added permission for the application pool user, in my case I just went ahead and added ASPNET, Network Service, IIS Anon User etc to have full permissions.
I needed to allow Everyone to have at least Read to the website folders and then IIS showed the non-secured content. I still think it is odd that forms auth. was kicking in and ignoring all web.config rules but anyway.
I found the error by turning off Forms Auth support in the IIS 7 manager. Then I got the process failure error because of file permissions.