2012-07-03 135 views
1

我做窗口:HTTP错误401.2 - 未经授权与被授权

Click Start, point to Administrative Tools, and then click Internet Information Services (IIS) Manager. In the Connections pane, expand the server name, expand Sites, and then select the site, application or Web service for which you want to enable Extended Protection for Windows authentication. Scroll to the Security section in the Home pane, and then double-click Authentication. In the Authentication pane, select Windows Authentication. Click Enable in the Actions pane. Click Advanced Settings in the Actions pane.

在web.config中<authentication mode="Windows" />

集如果我从VS2010开始应用之后 - 一切运作良好。 如果其他我从IIS启动应用程序我有问题。 请求的用户数据我输入Computer \ NameUser。 然后一个错误:

Error HTTP 401.2 - Unauthorized You have no right to view this page because of the inadmissibility of the authentication header.

更新:

enter image description here

UPDATE2: 文件:C:\ WINDOWS \ SYSTEM32 \ INETSRV \设置\对ApplicationHost.config

<location path="windowsAuthTest"> 
    <system.webServer> 
     <security> 
      <authentication> 
       <anonymousAuthentication enabled="false" userName="User" password="[enc:AesProvider:BZ7e2mkTjJL7Wo8xMm2PQKZ2biP1nKB2SjAfw9WmJoBhkMbl4DYqEJU0bzIj3CxF:enc]" /> 
       <windowsAuthentication enabled="true" useKernelMode="false"> 
        <extendedProtection tokenChecking="None" /> 
        <providers> 
         <clear /> 
         <add value="NTLM" /> 
         <add value="Negotiate" /> 
        </providers> 
       </windowsAuthentication> 
      </authentication> 
     </security> 
    </system.webServer> 
</location> 
+0

哪个版本的IIS? –

+0

@Steve B,iis 7 – Mediator

回答

0

之后,您访问s您的网站的安全性,您必须为用户窗口添加权限。

+0

我更新了我的文章。访问权限为 – Mediator

0

看看我的previous answer

基本上,这意味着身份验证票证不符合服务器的期望。

您应该强制服务器使用NTML或Kerberos(取决于您的身份验证策略)。

[编辑] as appcmd可能有点模糊,这里是手动停止强制NTLM身份验证。

  1. 导航到C:\Windows\System32\inetsrv\config
  2. 备份,备份,备份和rebackup对ApplicationHost.config
  3. 要确保备份再次
  4. 打开您最喜爱的XML编辑器
  5. 搜索该文件对ApplicationHost.config节点<location path="Your web site name/yourapplication">
  6. 设置正确的身份验证提供程序:



最重要的部分是,有所述<clear />节点。这将打破全局配置的继承。

这可以应用到整个IIS服务器,或特定的网站,或(像这里)特定的Web应用程序)。

我不确定,但我不知道这是否可以在网络中设置。直接在应用程序中配置,而不是IIS配置文件。这个值得进行测试。

+1

Steve B,我做错了什么,但这些方法不能帮助我 – Mediator

+0

尝试临时激活基本身份验证而不是Windows身份验证。我很确定这会起作用。如果我是对的,你唯一需要做的就是'appcmd.exe set config -section:system.webServer/security/authentication/windowsAuthentication /+"providers.[value='NTLM']“/ commit:apphost' –

+0

错误(消息:新对象添加缺少必需的属性。无法添加具有值“NTLM” 。)的唯一键属性“值”的输入集合类型的副本。 – Mediator

相关问题