我正在开发WEB API
Windows
Authentication
。我在web.config
中添加了以下配置
获取此问题:
此配置节不能在此路径中使用。
当节在父级被锁定时,就会发生这种情况。锁定在缺省情况下为(overrideModeDefault="Deny")
,或者由带有overrideMode="Deny"
或传统allowOverride="false"
的位置标签显式设置
请在这方面帮帮我。请提供如何在web api中实现窗口身份验证的步骤
发布于 2018-05-25 20:49:54
遇到此错误的原因可能是因为在IIS中通过web.config文件启用windowsauthentication的设置。要解决此问题,您必须调整IIS服务器的applicationhost.config文件。您需要告诉IIS,他自己的配置可能会被覆盖:
IIS Express的
下面的步骤(简单场景)以允许windows身份验证
确保webapi项目使用的是windows authentication.
<system.web>
<authentication mode="Windows"></authentication>
</system.web>
将IIS设置为windowsAuthenthication,而不设置其他任何值
<system.webServer>
<security>
<authentication>
<windowsAuthentication enabled="true" />
<anonymousAuthentication enabled="false" />
<basicAuthentication enabled="false"/>
</authentication>
</security>
</system.webServer>
https://stackoverflow.com/questions/50292398
复制相似问题