2
因此,我正在尝试配置WCF 4 REST应用程序以利用多个标准端点(用于帮助功能)。这是因为我的托管IIS进程启用了匿名和Windows身份验证,并且我的WCF应用程序中的某些终端需要一个或另一个(都导致异常)。WCF 4 REST - 用于身份验证的多个标准端点
以前,我能够通过定义一些绑定做到这一点:
<bindings>
<webHttpBinding>
<binding name="Anonymous">
<security mode="None" />
</binding>
<binding name="WindowsAuthentication">
<security mode="TransportCredentialOnly">
<transport clientCredentialType="Windows" />
</security>
</binding>
</webHttpBinding>
</bindings>
然后定义的服务,像这样:
<services>
<service name="Host.SubscriberInfoHost">
<endpoint address="" binding="webHttpBinding" bindingConfiguration="WindowsAuthentication" contract="Host.ISubscriberInfoHost" />
</service>
<service name="Utilities.Instrumentation.ServiceStatus.ServiceStatusHost">
<endpoint address="" binding="webHttpBinding" bindingConfiguration="Anonymous" contract="Utilities.Instrumentation.ServiceStatus.IServiceStatusHost" />
</service>
</services>
这是我试过到目前为止做同时使用标准端点模型:
<standardEndpoints>
<webHttpEndpoint>
<standardEndpoint name="Host.SubscriberInfoHost" helpEnabled="true" automaticFormatSelectionEnabled="true">
<security mode="TransportCredentialOnly">
<transport clientCredentialType="Windows" />
</security>
</standardEndpoint>
<standardEndpoint name="Utilities.Instrumentation.ServiceStatus.IServiceStatusHost" helpEnabled="true" automaticFormatSelectionEnabled="true">
<security mode="None" />
</standardEndpoint>
</webHttpEndpoint>
</standardEndpoints>
但是,这样做会使服务混淆,因为我收到:
System.InvalidOperationException: IIS specified authentication schemes 'Negotiate, Anonymous', but the binding only supports specification of exactly one authentication scheme. Valid authentication schemes are Digest, Negotiate, NTLM, Basic, or Anonymous. Change the IIS settings so that only a single authentication scheme is used
这正是我想摆脱。任何人都可能给我一个关于如何使用新的标准端点模型来设置这种情况的手?谢谢!
据我所知,一个服务只能使用一种认证模式。这是否工作? –
这确实对我有用,请记住,这已经很久以前了,我相信.NET 3.5 –