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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 17:15:40  来源:igfitidea点击:

ASP.NET, 401 - Unauthorized, Valid account

c#asp.netwindowsauthenticationconfig

提问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

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 身份验证?

enter image description here

在此处输入图片说明