【问题标题】:HTTP 401.2 Unauthorized error with Windows authentication from remote machineHTTP 401.2 来自远程计算机的 Windows 身份验证出现未经授权的错误
【发布时间】:2014-01-04 12:32:06
【问题描述】:

我的网站启用了 Windows 身份验证,并首先列出了协商提供程序,因为我想使用 Kerberos 进行委派。当我从 Web 服务器本身的浏览器运行网站时,它工作正常。当我在域中的另一台机器上使用 IE 时,我得到了登录框。 3 次尝试后,我收到 HTTP 401.2 错误:未经授权。

我已确保应用程序池使用的域帐户对网站文件夹具有读取和执行权限,我在访问网站时登录的域帐户也是如此(我也加入了'Authenticated Users' 是很好的衡量标准)。

有趣的是,如果我尝试使用 Web 服务器的 IP 而不是名称来访问该站点,它可以正常加载。

有人有想法吗?

【问题讨论】:

  • 我让它工作了——我使用的是内核模式,但在运行应用程序池的域帐户上设置了我的 SPN。所以关闭了内核模式。

标签: windows http authentication iis kerberos


【解决方案1】:

在我第一次遇到这个问题一年后,我已经解决了。

http://blogs.technet.com/b/proclarity/archive/2011/03/08/useapppoolcredentials-true-with-kerberos-delegation-on-2008.aspx得到提示

需要在applicationHost.config中的windowsAuthentication元素上设置useAppPoolCredentials="true"(可以通过IIS管理器设置)

    <system.webServer>
        <security>
            <authentication>
                <anonymousAuthentication enabled="false" />
                <windowsAuthentication enabled="true" useKernelMode="true" useAppPoolCredentials="true">
                    <providers>
                        <clear />
                        <add value="Negotiate" />
                    </providers>
                    <extendedProtection tokenChecking="None" />
                </windowsAuthentication>
            </authentication>
        </security>
    </system.webServer>

【讨论】:

    【解决方案2】:

    您在使用 DNS 名称时获得 401.2 的原因很可能是因为在 AD 中将您使用的名称注册为服务主体名称 (SPN)。

    这里有几个链接可以帮助你:

    使用 IIS 7.0/7.5 进行 Kerberos 身份验证的服务主体名称 (SPN) 清单 http://blogs.msdn.com/b/webtopics/archive/2009/01/19/service-principal-name-spn-checklist-for-kerberos-authentication-with-iis-7-0.aspx

    为 Kerberos 连接注册服务主体名称http://technet.microsoft.com/en-us/library/ms191153.aspx

    【讨论】:

    • 我得到了它 - 我使用的是内核模式,但在运行应用程序池的域帐户上设置了我的 SPN。所以关闭了内核模式。
    猜你喜欢
    • 1970-01-01
    • 2022-12-13
    • 2013-08-09
    • 2014-03-03
    • 1970-01-01
    • 2018-07-09
    • 2023-04-06
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多