如何禁用 IIS 快速所有身份验证?

问题描述 投票:0回答:1

对于 Windows 7 上的 IIS Express 8.0,我在 applicationhost.config 文件中设置了有关身份验证设置。

    <authentication>

        <anonymousAuthentication enabled="false" />

        <basicAuthentication enabled="false" />

        <clientCertificateMappingAuthentication enabled="false" />

        <digestAuthentication enabled="false" />

        <iisClientCertificateMappingAuthentication enabled="false">
        </iisClientCertificateMappingAuthentication>

        <windowsAuthentication enabled="true">
            <providers>
                <add value="Negotiate" />
                <add value="NTLM" />
            </providers>
        </windowsAuthentication>
    </authentication>

当我<

windowsAuthentication enabled="true"
>时,我收到一个弹出框,提示输入Windows帐户和密码。我进去了,一切都很好。

但是,我想禁用所有身份验证,因为这是内部使用的。所以,我首先禁用了 windowsAuthentication。然后尝试 <

anonymousAuthentication enabled="true"
/>,我收到 401.2 错误以及消息“访问被拒绝”。如果我更改为 <
anonymousAuthentication enabled="false" /
>,我会收到相同的 401.2 错误,但浏览器中的行不同且更多:

HTTP Error 401.2 - Unauthorized
You are not authorized to view this page due to invalid authentication headers.
Most likely causes:
•No authentication protocol (including anonymous) is selected in IIS.
•Only integrated authentication is enabled, and a client browser was used that does not support integrated authentication.
•Integrated authentication is enabled and the request was sent through a proxy that changed the authentication headers before they reach the Web server.
•The Web server is not configured for anonymous access and a required authorization header was not received.
•The "configuration/system.webServer/authorization" configuration section may be explicitly denying the user access.
Things you can try:
•Verify the authentication setting for the resource and then try requesting the resource using that authentication method.
•Verify that the client browser supports Integrated authentication.
•Verify that the request is not going through a proxy when Integrated authentication is used.
•Verify that the user is not explicitly denied access in the "configuration/system.webServer/authorization" configuration section.
•Check the failed request tracing logs for additional information about this error. For more information, click here. 
More Information:
This error occurs when the WWW-Authenticate header sent to the Web server is not supported by the server configuration. Check the authentication method for the resource, and verify which authentication method the client used. The error occurs when the authentication methods are different. To determine which type of authentication the client is using, check the authentication settings for the client. 
View more information »

我能做什么?我想在没有任何身份验证的情况下访问该页面。

iis iis-express
1个回答
2
投票

我解决了。 之后

<windowsAuthentication enabled="false" />
<anonymousAuthentication enabled="true" />

我在网上发现了另一个我以前不知道的配置,web.config。我的 web.config 中的行是:

<deny users="?" />

我把它改为:

<allow users="?" />

现在,一切都很好。

© www.soinside.com 2019 - 2024. All rights reserved.