2008-11-25 101 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服務調用的憑據添加到標記)失敗的環境中的相同問題。

相關問題