将 Windows 用户凭据传递给 Web 服务

发布于 2024-08-05 05:17:52 字数 240 浏览 2 评论 0原文

我有一个使用 Windows 身份验证的 ASP 3.5 Web 表单应用程序,需要调用使用集成 Windows 身份验证的基于 Soap 的 Web 服务(SSRS 2005 报告服务)。然而,从 asp 后端调用 Web 服务不断抛出 401 错误。 如果我在 Web 服务上打开匿名身份验证,它可以使用 IUSR_xxx 帐户正常工作,但是我希望它使用访问 ASP Web 应用程序的用户的 Windows 帐户进行连接。如何传递 Windows 用户凭据?

I have a ASP 3.5 web forms app using windows authentication that needs to call a soap based web service (the SSRS 2005 report service) which uses integrated windows authentication. However the call to the web service from the asp backend keeps throwing a 401 error.
If I turn on anonymous authenticatoin on the web service it works ok using the IUSR_xxx account however I want it to connect using the windows account of the user accessing the asp web app. How can I pass through the windows user credentials?

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

本王不退位尔等都是臣 2024-08-12 05:17:52

您必须通过向代理提供默认凭据来验证您的网络服务。像这样

localhost.ServiceX myProxy = new localhost.ServiceX();
myProxy.Credentials = System.Net.CredentialCache.DefaultCredentials;

you have to authenticate your webservice by supplying the default credential to your proxy. like this

localhost.ServiceX myProxy = new localhost.ServiceX();
myProxy.Credentials = System.Net.CredentialCache.DefaultCredentials;
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文