使用 AD 帐户访问 WSS Lists.asmx Web 服务时出现未经授权的访问

发布于 2024-08-20 18:23:24 字数 793 浏览 5 评论 0原文

我遇到一个问题,我尝试访问远程或本地站点中的 Lists.asmx Web 服务,但收到 401 错误。需要明确的是,这是/_vti_bin/Lists.asmx。设置是我有一个 WSS 3.0 站点,它通过肥皂连接到另一个 WSS/MOSS 站点的列表服务。在我们的舞台环境中,这两个站点位于同一个盒子上,但在开发中它们是分开的。无论情况如何,它们都位于同一域中。最初(在重建之前),Web 服务调用在开发中运行良好,但在阶段中运行不佳,这虽然令人困惑,但至少证实了我对 Web 服务的实现是正确的,而问题是授权之一。这是我的初始列表服务设置代码:

new Lists
{
     Url = Utility.AppSetting("WSS.Url", true),
     Credentials = new NetworkCredential
     {
           UserName = Utility.AppSetting("WSS.UserName", true),
           Password = Utility.AppSetting("WSS.Password", true),
           Domain = Utility.AppSetting("WSS.Domain", true)
     }
};

我手动指定服务器上完全访问帐户的域凭据。但是我怀疑上面的代码没有执行任何操作,并且该服务只是使用 AD 进行身份验证,即我的应用程序池帐户(在开发中是我的超级开发帐户)。为了减轻发布过程的负担,我希望能够显式设置服务的凭据,而不是依赖基础设施官员必须授予他的应用程序池帐户读取/Web 服务访问远程 wss 实例的权限。

干杯

I am having an issue where I try to access the Lists.asmx web service in a remote or local site and am getting a 401 error. To be clear, this is /_vti_bin/Lists.asmx. The setup is I have one WSS 3.0 site which connects via soap to the lists service of another, WSS/MOSS site. On our stage environment these two sites are on the same box, but in dev they're seperate. Whatever the situation, they're all on the same domain. Originally (prior to a rebuild) the web service calls worked fine in dev, but not in stage, which while puzzling at least confirmed that my implementation of the web service is correct, and the issue is one of authorisation. Here is my initial Lists service setup code:

new Lists
{
     Url = Utility.AppSetting("WSS.Url", true),
     Credentials = new NetworkCredential
     {
           UserName = Utility.AppSetting("WSS.UserName", true),
           Password = Utility.AppSetting("WSS.Password", true),
           Domain = Utility.AppSetting("WSS.Domain", true)
     }
};

With me manually specifying the domain credentials of the full access account on the server. However I suspect that the above code doesn't do anything and the service just authenticates using AD, i.e. my app pool account (which on dev is my super powered dev account). To lesson the burden on the release process, I would like to be able to explicitly set the credentials for the service, and not rely on the infrastructure official having to give his app pool account read/web service access to a remote wss instance.

Cheers

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

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

发布评论

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

评论(2

瞎闹 2024-08-27 18:23:24

尝试:

Credentials = System.Net.CredentialCache.DefaultCredentials

或者

Credentials = System.Net.CredentialCache.DefaultNetworkCredentials

Try:

Credentials = System.Net.CredentialCache.DefaultCredentials

Or

Credentials = System.Net.CredentialCache.DefaultNetworkCredentials
昵称有卵用 2024-08-27 18:23:24

作为参考,问题是环回检查是 Server2k8 的一个很大的问题。禁用它修复了该错误。

For reference, issue was that the loopback check is very much an issue with Server2k8. Disabling it fixed the bug.

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