windows ASP.NET, 401 - 未经授权的有效帐户
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/6522276/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
ASP.NET, 401 - Unauthorized, Valid account
提问by Daniel
This is a bit complicated
这有点复杂
I'm running a .NET 4.0 site on a IIS 7.5, using Windows Authentication and running the site in custom application pool with Identity set to a Domain Admin account(need to run scripts with admin rights).
我正在 IIS 7.5 上运行 .NET 4.0 站点,使用 Windows 身份验证并在自定义应用程序池中运行站点,并将身份设置为域管理员帐户(需要运行具有管理员权限的脚本)。
My webconfig is as follows:
我的网络配置如下:
<authentication mode="Windows"/>
<authorization>
<deny users="?"/>
</authorization>
</system.web>
Whenever i log on to the site, using IE8 (it should authenticate me automaticly) it asks me for credentials, and I supply some generic Domain User credentials, I'm denied until it gives me the error: 401 - Unauthorized: Access is denied due to invalid credentials.
每当我使用 IE8(它应该自动对我进行身份验证)登录到该站点时,它都会要求我提供凭据,并且我提供了一些通用的域用户凭据,我被拒绝,直到它给我错误:401 - 未经授权:访问被拒绝由于凭据无效。
However, If I supply it my Domain Admin credentials, I'm granted access, good for me, but bad for my users :)
但是,如果我提供我的域管理员凭据,我将被授予访问权限,这对我有好处,但对我的用户不利:)
What is going on?
到底是怎么回事?
Some common problems people have are: Setting NTML as the default Authentication provider, no dice. And the wwwroot folder isn't shared
人们遇到的一些常见问题是: 将 NTML 设置为默认身份验证提供程序,没有骰子。并且 wwwroot 文件夹未共享
采纳答案by Daniel
- After removing IIS role and creating it again.
- Setting up a new App Pool with the right credentials, and .NET 4.0
- Running this fix again http://www.gotknowhow.com/articles/fix-bad-module-managedpipelinehandler-in-iis7
- Recreating my site under default website
- Converting it to an application
- Setting it up to use the right pool
- 删除 IIS 角色并重新创建后。
- 使用正确的凭据和 .NET 4.0 设置新的应用程序池
- 再次运行此修复程序 http://www.gotknowhow.com/articles/fix-bad-module-managedpipelinehandler-in-iis7
- 在默认网站下重新创建我的网站
- 将其转换为应用程序
- 设置它以使用正确的池
The problem has solved itself
问题已经自行解决
回答by matiasnj
Did you enable your Windows authentication in your IIS7.5 for site in your Virtual Directory?
您是否在 IIS7.5 中为虚拟目录中的站点启用了 Windows 身份验证?