2008-11-25 102 views
6

几个月前,我写了一个windows服务,它使用_vti_bin/lists.asmx函数GetListItemChanges来ping一个Sharepoint列表。直到几个星期前,当我的公司将我们的Sharepoint实例升级到SP1时,它工作良好。
现在,每当我的服务尝试访问SharePoint我收到401.1身份验证错误:通过网络服务访问Sharepoint列表时发生身份验证错误

错误:

You are not authorized to view this page
You do not have permission to view this directory or page using the credentials that you supplied.
Please try the following: Contact the Web site administrator if you believe you should be able to view this directory or page.
HTTP Error 401.1 - Unauthorized: Access is denied due to invalid credentials.
Internet Information Services (IIS)

我已经检查过我的网站上的权限没有改变。这里是在我称之为列表的代码:

Lists listsService = new Lists(); 
listsService.Credentials = new NetworkCredential("UserName", "Password", "domain"); 
Result = listsService.GetListItemChanges("List name", null, dTime.ToString(), null); 

它也被带到了我的注意,基本身份验证可能已经在我们的农场被禁用。我不相信我在使用,但我可能弄错了。

回答

0

你的内部网络上有代理吗?

我在思考双跳,而且基本身份验证并不倾向于那个,但那个NTLM是。如果你有一个代理,那么双跳是一个问题。如果您直接访问本机并且只能计算一个跃点(服务于Web服务),那么这不应该成为问题。

1

基于所提供的信息,我怀疑这是一个编程错误。您可以访问托管SharePoint网站的服务器上的IIS管理器界面吗?如果是这样,请检查允许的有效认证技术。匿名连接是否允许?是否启用Windows集成身份验证? HTTP基本认证?询问您的基础架构/ SharePoint人员有关双跳(代理)的可能性。如果是这样,那也可能工作,但设置(Kerberos委派)是一件很痛苦的事情。该NetworkCredentials类似乎支持所有IIS支持的标准身份验证方案(除了形式):

http://msdn.microsoft.com/en-us/library/system.net.networkcredential(VS.80).aspx

您可能需要有基础设施的人设置的SPN为SharePoint Web前端:

http://support.microsoft.com/kb/929650

但是,我建议不要通过IIS管理器更改任何内容。让SharePoint管理员通过SharePoint管理中心对网站允许的身份验证技术进行更改。

问候, 山姆

1

我刚刚发现了一个非常类似的问题,并解决它由于采用了MS知识库文章: http://support.microsoft.com/kb/896861

,你应该尝试的位是这样的:

Method 2: Disable the loopback check Follow these steps:

  1. Click Start, click Run, type regedit, and then click OK.
  2. In Registry Editor, locate and then click the following registry key: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa
  3. Right-click Lsa, point to New, and then click DWORD Value.
  4. Type DisableLoopbackCheck, and then press ENTER.
  5. Right-click DisableLoopbackCheck, and then click Modify.
  6. In the Value data box, type 1, and then click OK.
  7. Quit Registry Editor, and then restart your computer.

这解决了我在所有常规解决方案(将Web服务调用的凭据添加到标记)失败的环境中的相同问题。

相关问题