SharePoint 2010 中的 WCF 服务不进行模拟,甚至不传递凭据
- SharePoint 门户处于声明模式,并且该服务托管在 /_vti_bin 中。
- 我正在使用 MultipleBaseAddressBasicHttpBindingServiceHostFactory,按照 http://msdn.microsoft.com/ en-us/library/ff521586.aspx。
添加对服务的引用会生成一个应该使用 NTLM 的绑定,因此应该正确配置该服务。在同一台计算机上运行的服务客户端(目前)实例化一个新的 BasicHttpBinding,将 ClientCredentialType 设置为 Ntlm,将 AllowNtlm 设置为 true,甚至(在某些测试中)将 Credentials.Windows.ClientCredential 设置为 DefaultNetworkCredentials 或特定 NetworkCredentials。
无论我做什么,Thread.CurrentPrinciple 在服务端始终是匿名的,ServiceSecurityContext.Current.WindowsIdentity 同样是空的。
我在这里做错了什么?
- The SharePoint portal is in Claims mode, and the service is hosted in /_vti_bin.
- I'm using the MultipleBaseAddressBasicHttpBindingServiceHostFactory, as per http://msdn.microsoft.com/en-us/library/ff521586.aspx.
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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论