我要坚持这个,找不到任何体面的信息任何一个..
有关使用WCF和Ntlm模拟连接到SharePoint 3.0 Web服务的信息很多.但是,当访问SharePoint服务的客户端远程访问SharePoint网络并需要进行身份验证时,最好如何配置和传递凭据到SharePoint服务.
我可以在servicemodel.config中的SharePoint框中指定一个Windows用户名和密码本地.我们的SharePoint实例在访问它的域之外独立运行.因此,域名用户不存在于共享点框上,因此模拟是不相关的.
我已经尝试过许多组合,如下面的代码..但是我反复得到例外:
“HTTP请求是未经授权的客户端认证方案”匿名“.从服务器接收到的认证头是’NTLM,Basic realm =”wss.internaldev.local“’.
任何人都可以提供使用Windows凭据连接到“远程”SharePoint Web服务的示例?
ListsSoapClient proxy = new ListsSoapClient(); proxy.ClientCredentials.Windows.ClientCredential.UserName = "admin_user"; proxy.ClientCredentials.Windows.ClientCredential.Password = "admin_password"; proxy.ClientCredentials.Windows.AllowedImpersonationLevel = System.Security.Principal.TokenImpersonationLevel.Identification; listItems = proxy.GetListItems(...); proxy.Close();
绑定示例:
<security mode="TransportCredentialOnly"> <transport clientCredentialType="Windows" proxyCredentialType="None" /> </security>
要么..
<security mode="TransportCredentialOnly"> <transport clientCredentialType="Ntlm" /> </security>
行为:
<behavior name="behavior_WSS"> <clientCredentials> <windows allowedImpersonationLevel="Impersonation" allowNtlm="true" /> </clientCredentials> </behavior>
要么
<windows allowedImpersonationLevel="Delegation" allowNtlm="true" />
解决方法@H_502_32@
你试过
the things suggested here吗
例如,在代码中:
proxy.ClientCredentials.Windows.AllowedImpersonationLevel = TokenImpersonation.Impersonate;
// AllowNtlm = false;
例如,在代码中:
proxy.ClientCredentials.Windows.AllowedImpersonationLevel = TokenImpersonation.Impersonate; // AllowNtlm = false;