【发布时间】:2010-03-19 09:56:47
【问题描述】:
我编写了一个使用 .net 3.5 WebService 的 WPF 4.0 Windows 应用程序。当托管的 Web 服务允许匿名连接时,这可以正常工作,但是当我们上线时我需要使用的 WebService 将保存在启用了集成身份验证的网站中。
运行 WPF 应用程序的人将登录到与 Web 服务器位于同一域中的计算机上,并且如果使用 NTLM auth 的 Web 浏览器浏览它,则有权查看 WebService(无需输入任何身份验证信息)已启用。
是否可以将运行应用程序的已登录用户的详细信息传递给 WebService?
这是我目前正在使用的代码:
MyWebService.SearchSoapClient client = new SearchSoapClient();
//From the research I've done I think I need to something with these:
//UserName.PreAuthenticate = true;
//System.Net.CredentialCache.DefaultCredentials;
List<Person> result = client.FuzzySearch("This is my search string").ToList();
任何指针都非常感谢。
这是我当前拨打电话时收到的错误消息:
HTTP 请求未经授权 客户端认证方案 '匿名的'。身份验证标头 从服务器收到的是 '协商、NTLM、摘要 qop="auth",algorithm=MD5-sess,nonce="+Upgraded+v17{hashremoved}",charset=utf-8,realm="Digest"'。
【问题讨论】:
标签: .net wpf windows web-services windows-authentication