SharePoint 2010 中的 WCF 服务不进行模拟,甚至不传递凭据

发布于 2024-11-10 08:16:32 字数 652 浏览 6 评论 0原文

添加对服务的引用会生成一个应该使用 NTLM 的绑定,因此应该正确配置该服务。在同一台计算机上运行的服务客户端(目前)实例化一个新的 BasicHttpBinding,将 ClientCredentialType 设置为 Ntlm,将 AllowNtlm 设置为 true,甚至(在某些测试中)将 Credentials.Windows.ClientCredential 设置为 DefaultNetworkCredentials 或特定 NetworkCredentials。

无论我做什么,Thread.CurrentPrinciple 在服务端始终是匿名的,ServiceSecurityContext.Current.WindowsIdentity 同样是空的。

我在这里做错了什么?

Adding a reference to the service yields a binding which should use NTLM, so the service should be configured correctly. The service client, which runs on the same computer (for now) instantiates a new BasicHttpBinding, sets ClientCredentialType to Ntlm, AllowNtlm to true and even (in some tests) the Credentials.Windows.ClientCredential to DefaultNetworkCredentials or specific NetworkCredentials.

No matter what I do, the Thread.CurrentPrinciple is always anonymous on the service side, and ServiceSecurityContext.Current.WindowsIdentity is equally empty.

What am I doing wrong here?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文