WCF Streaming on service with Windows Authentication Endpoint

编程入门 行业动态 更新时间:2024-10-23 13:30:59
本文介绍了WCF Streaming on service with Windows Authentication Endpoint的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

我有一个 WCF 服务,它有两个端点,由下面的配置文件定义:

I have a WCF service with two endpoints defined by the configuration file below:

 <system.serviceModel>
        <services>
          <service name="SyncService" behaviorConfiguration="SyncServiceBehavior">
            <endpoint name="Data" address="Data" binding="basicHttpBinding" bindingConfiguration="windowsAuthentication" contract="ISyncService"/>
            <endpoint name="File" address="File" binding="basicHttpBinding" bindingConfiguration="httpLargeMessageStream" contract="ISyncService"/>
            <endpoint address="mex" binding="webHttpBinding" bindingConfiguration="windowsAuthentication" contract="IMetadataExchange"/>
          </service>
        </services>
        <bindings>
          <basicHttpBinding>
            <binding name="httpLargeMessageStream" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647" transferMode="Streamed" messageEncoding="Mtom" />
            <binding name="windowsAuthentication" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647">
              <security mode="TransportCredentialOnly">
                <transport clientCredentialType="Windows" proxyCredentialType="None" realm=""></transport>
                <message algorithmSuite="Default" clientCredentialType="UserName"/>
              </security>
            </binding>
          </basicHttpBinding>
          <webHttpBinding>
            <binding name="windowsAuthentication">
              <security mode="TransportCredentialOnly">
                <transport clientCredentialType="Windows"></transport>
              </security>
            </binding>
          </webHttpBinding>
      </bindings>
        <behaviors>
          <serviceBehaviors>
            <behavior name="SyncServiceBehavior">
              <serviceMetadata httpGetEnabled="true"/>
              <serviceDebug includeExceptionDetailInFaults="true"/>
              <dataContractSerializer maxItemsInObjectGraph="2147483647"/>
            </behavior>
          </serviceBehaviors>
        </behaviors>
        <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true"></serviceHostingEnvironment>
      </system.serviceModel>

我想对数据端点使用 Windows 身份验证,但最近发现您无法使用 Windows 身份验证通过 HTTP 进行流式传输.我删除了 File 端点的安全元素,但仍然收到以下错误:

I want to use windows authentication for the Data endpoint, but have recently discovered that you cannot use windows authentication for streaming over HTTP. I removed the security element for the File endpoint, but still get the following error:

HTTP 请求流不能与 HTTP 结合使用验证.禁用请求流或指定匿名HTTP 身份验证.参数名称:bindingElement

HTTP request streaming cannot be used in conjunction with HTTP authentication. Either disable request streaming or specify anonymous HTTP authentication. Parameter name: bindingElement

是否可以在同一服务上让两个端点使用不同的身份验证方法?为什么我不能使用 Windows 身份验证进行流式传输?

Is it possible to have two endpoints on the same service use different authentication methods like this? Why can't I use windows authentication for streaming?

我也尝试过这个帖子中的建议,但无济于事:

I have also tried what was suggested in this thread, but to no avail:

哪种认证模式可以使用basichhtpbinding 来保护使用Streaming 的WCF 服务吗?

推荐答案

不幸的是,这不受支持.

Unfortunately this is not supported.

这篇关于WCF Streaming on service with Windows Authentication Endpoint的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

更多推荐

[db:关键词]

本文发布于:2023-04-26 19:59:50,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1141085.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:service   Streaming   WCF   Endpoint   Authentication

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!