1

我創建了一個自定義聲明提供程序,允許用戶從現有網站登錄到SharePoint。此問題包括以username @ domain格式提出的UPN索賠。用戶可以正常登錄,直到在SharePoint Web應用程序web.config中啓用mapToWindowsuseWindowsTokenService下的samlSecurityTokenRequirement。此時,我收到標準的SharePoint錯誤消息,並且以下異常在跟蹤中可見。Performance Point/Excel Services的Sharepoint聲稱/ c2wts問題

Exception fetching current thread user in SPUtility.CacheClaimsIdentity: Exception of type 'System.ArgumentException' was thrown. 
Parameter name: identity 0.00143314303912927 0.001357 
Runtime Tag(tkau) System.ArgumentException: Exception of type 'System.ArgumentException' was thrown. 
Parameter name: encodedValue 
    at Microsoft.SharePoint.Administration.Claims.SPClaimEncodingManager.DecodeClaimFromFormsSuffix(String encodedValue) 
    at Microsoft.SharePoint.Administration.Claims.SPClaimProviderManager.GetProviderUserKey(String encodedSuffix) 
    at Microsoft.SharePoint.ApplicationRuntime.SPHeaderManager.AddIsapiHeaders(HttpContext context, String encodedUrl, NameValueCollection headers) 
    at Microsoft.SharePoint.ApplicationRuntime.SPRequestModule.PreRequestExecuteAppHandler(Object oSender, EventArgs ea) 
    at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() 
    at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) 

我認爲C2WTS模擬部分工作正常,因爲如果我禁用由傳遞UPN聲明所代表的AD帳戶,然後我得到一個不同的「訪問被拒絕」試圖登錄當在SharePoint中顯示錯誤該用戶。

而且中的SharePoint記錄它確實出現了UPN已被轉換到Windows AD帳戶,因爲我得到了在日誌中以下內容:

Verbose ____Current User=i:DOMAINNAME\SSO_administrator 7b4eac31-d017-429c-87f2-a3100ece6797 

更新

看起來也許這不是在SharePoint中使用的受支持設置。但是,如果我離開設置,似乎嵌入SharePoint網站中的Performance Point和Excel Services報告無法正常工作。我得到這樣的錯誤:

  • The data connection uses Windows Authentication and user credentials could not be delegated.(EXCEL)
  • $Resources:ppsma.ServerCommon, ErrorCode_DataSourceCannotGetWindowsIdentityForNonWindowsClaim;(表現來看SSRS報告)

有沒有辦法解決?我需要用戶的UPN作爲用於查詢這些SSAS數據的帳戶,因此使用固定連接字符串是不可行的。

+0

我一如往常,實施AD自定義集成與我的內部網門戶時,username @ domain與DOMAIN \ username相同,但這不正確。事實上,windows itentity提供者正在使用稱爲「short」主體名稱的形式:DOMAIN \ username,但長格式與dfault ASP.NET登錄表單幾乎不兼容,因爲'[email protected]。name'不能自動翻譯成縮寫形式,所以每次用戶連接到我的Intranet門戶時,我都會手動調用ActiveDirectory模擬 –

+0

嘗試使用SPContext.Current.User.Identity.Name作爲參數 –

回答

0

事實證明,在mapToWindows配置值未在SharePoint支持。您必須依賴SharePoint的每個聲明部分,並自行轉換令牌。這有點痛苦,因爲PerformancePoint和Excel Services沒有聲明意識,所以如果您的SSAS多維數據集需要AD安全性,最終會被Windows身份驗證卡住。

0