gpt4 book ai didi

wcf - 如何让 serviceCredentials > windowsAuthentication > allowAnonymousLogons 在 WCF 中工作?

转载 作者:行者123 更新时间:2023-12-04 04:56:06 24 4
gpt4 key购买 nike

我有一个作为 netTcpBinding 公开的 WCF 服务。

在服务方面:

<netTcpBinding>             
<binding>
<security mode="Message">
<message clientCredentialType="Windows"/>
</security>
</binding>
</netTcpBinding> ...
// Service behavior
<behavior>
<serviceCredentials>
<windowsAuthentication allowAnonymousLogons="true" />
</serviceCredentials>
</behavior>

我无法从另一台机器上的匿名用户访问此服务。 (错误:无法验证协商失败的重传。)

做什么
<windowsAuthentication allowAnonymousLogons="true" /> 

做?

我希望 Windows 和匿名用户都可以通过 net tcp 绑定(bind)访问我的服务。我可以使用用户名验证来做到这一点,但是如何使用 Windows 身份验证来做到这一点?

谢谢

最佳答案

您是否在客户端上设置了 AllowedImpersonationLevel?

<behaviors>
<endpointBehaviors>
<behavior>
<clientCredentials>
<windows allowedImpersonationLevel="Anonymous"/>
</clientCredentials>
</behavior>
</endpointBehaviors>
</behaviors>

或者
client.ClientCredentials.Windows.AllowedImpersonationLevel = 
System.Security.Principal.TokenImpersonationLevel.Anonymous;

关于wcf - 如何让 serviceCredentials > windowsAuthentication > allowAnonymousLogons 在 WCF 中工作?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16734124/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com