Security settings for this service require 'Anonymous' Authentication but it is not enabled for the ...

When host WCF service on IIS, you may encounter this issue. Of course we can simply enable Anonymous Authentication on IIS to resolve this issue.

However, sometimes we don't want to enable Anonymous Authentication on IIS, then we need to adjust the service security settings to fix this issue. What is security settings will require Anonymous Authentication? Let us check the following sample:

<?xml version="1.0"?>
<configuration>

  <system.web>
    <compilation debug="true" targetFramework="4.0" />
  </system.web>
  <system.serviceModel>
    <bindings>
      <basicHttpBinding>
        <binding name="TestBinding">
          <security mode="Transport">
            <transport clientCredentialType="None"></transport>
          </security>
          <security mode="Message">
            <message clientCredentialType="UserName"/>
          </security>
        </binding>
      </basicHttpBinding>
    </bindings>
    <services>
      <service name="WcfServiceTest.IServices1" behaviorConfiguration="TestBehaviro">
        <endpoint address="" binding="basicHttpBinding" bindingConfiguration="TestBinding" contract="WcfServiceTest.IService1"></endpoint>
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetaDataExchange"></endpoint>
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior name="TestBehavior">
          <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
          <serviceMetadata httpGetEnabled="true"/>
          <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->
          <serviceDebug includeExceptionDetailInFaults="false"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
  </system.serviceModel>
 <system.webServer>
    <modules runAllManagedModulesForAllRequests="true"/>
  </system.webServer>
  
</configuration>

The setttings require Anonymous Authentication:

1. Message security always require Anonymous Authentication

          <security mode="Message">
            <message clientCredentialType="UserName"/>
          </security>

2. HttpClientCredentialType.None specifie Anonymous Authentication

          <security mode="Transport">
            <transport clientCredentialType="None"></transport>
          </security>

Note: Transport and Message securities are not allow to being used together in earlier .Net version.

3. MetaDataExchane endpoint require Anonymous Authentication

        <endpoint address="mex" binding="mexHttpBinding" contract="IMetaDataExchange"></endpoint>

Above are all I found by performing some testing, I am not 100% sure it is correct. But is helps me resolve this issue at least.

转载于:https://www.cnblogs.com/LeoTang/archive/2012/08/08/2628736.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
你遇到的错误是 "The project seems to require yarn but it's not installed." 这个错误通常发生在使用 Vue 生成项目并启动时。这个错误表示你的项目需要使用 yarn 这个包管理工具,但你的电脑上没有安装 yarn。 解决这个问题的方法很简单,你只需要按照以下步骤操作: 1. 首先,删除你的项目中的 yarn.lock 文件。这个文件是用来锁定项目依赖版本的,删除它可以避免冲突。 2. 然后,在终端中运行命令 npm install -g yarn。这个命令会全局安装 yarn。 3. 安装完成后,你可以再次尝试启动你的 Vue 项目,这次应该就不会再出现 "The project seems to require yarn but it's not installed." 的错误了。 这种错误在使用 Vue 生成项目时比较常见,但是通过删除 yarn.lock 文件并安装 yarn 这个包管理工具,你应该能够成功解决这个问题。希望这个解答对你有帮助!<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *2* *3* [WebStream生成vue项目报错Error: The project seems to require yarn but it‘s not installed.](https://blog.csdn.net/weixin_53289224/article/details/126878046)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 100%"] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值