首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >在IIS中托管Web API Windows身份验证

在IIS中托管Web API Windows身份验证
EN

Stack Overflow用户
提问于 2018-05-11 20:30:10
回答 1查看 1.1K关注 0票数 0

我正在开发WEB API Windows Authentication。我在web.config中添加了以下配置

获取此问题:

此配置节不能在此路径中使用。

当节在父级被锁定时,就会发生这种情况。锁定在缺省情况下为(overrideModeDefault="Deny"),或者由带有overrideMode="Deny"或传统allowOverride="false"的位置标签显式设置

请在这方面帮帮我。请提供如何在web api中实现窗口身份验证的步骤

EN

回答 1

Stack Overflow用户

发布于 2018-05-25 20:49:54

遇到此错误的原因可能是因为在IIS中通过web.config文件启用windowsauthentication的设置。要解决此问题,您必须调整IIS服务器的applicationhost.config文件。您需要告诉IIS,他自己的配置可能会被覆盖:

IIS Express的

下面的步骤(简单场景)以允许windows身份验证

确保webapi项目使用的是windows authentication.

代码语言:javascript
复制
<system.web>
    <authentication mode="Windows"></authentication>
 </system.web>

  1. 通过配置配置文件

将IIS设置为windowsAuthenthication,而不设置其他任何值

代码语言:javascript
复制
  <system.webServer>
        <security>
              <authentication>
                <windowsAuthentication enabled="true" />
                <anonymousAuthentication enabled="false" />
                <basicAuthentication enabled="false"/>
              </authentication>
            </security> 
 </system.webServer>

  1. 如上所述调整IIS的applicationhost.config。
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/50292398

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档