笔者尝试在自己的测试环境中为SharePoint 2013配置Office Web Apps, 遇到了下面的问题.
文档无法在IE中打开, 报错如下.
排查的过程如下:
1. 查看SharePoint的ULS Log, 发现下面的条目:
06/05/2013 23:37:59.16 w3wp.exe (0x067C) 0x0124 SharePoint Foundation Claims Authentication aj0os Exception Exception occurred while creating an SPIdentityContext from SPUserToken '47e03bd70000000034000000efeeebea030000000c00000000000000dfdedbda0100000000000000010100000000000000000000'. System.NotSupportedException: Can not create an identity context for system account user token. at Microsoft.SharePoint.IdentityModel.SPIdentityContext.Create(SPUserToken token, Boolean isShareByLinkGuestUser) StackTrace: at onetnative.dll: (sig=6aba1f5f-ccc4-4590-af00-b8ffe7fe99a0|2|onetnative.pdb, offset=28BE6) at onetnative.dll: (offset=152A9) 19a6229c-9bdd-2062-33bb-ed8cf11e8631
2. 改用普通帐号登录SharePoint站点, 问题依然存在. 但是SharePoint ULS log已经不再报错了.
3. 登录WAC服务器, 在如下的位置找到ULS日志:
C:\ProgramData\Microsoft\OfficeWebApps\Data\Logs\ULS
发现如下的报错:
06/05/2013 23:38:56.21 w3wp.exe (0x1780) 0x2130 Office Web Apps WAC Hosting Interaction adhrj Monitorable HttpRequestAsync (WOPICheckFile,WACSERVER), request failure [HttpResponseCode:Forbidden, HttpResponseCodeDescription:Forbidden, url:http://sp2013-ca/_vti_bin/wopi.ashx/files/ee46dad3597f414b91d547007d786394?access_token=REDACTED_1056&access_token_ttl=1370536736053] 9bc1abde-e31f-4ec4-9bbc-741b8a169ac6
06/05/2013 23:38:56.21 w3wp.exe (0x1780) 0x258C Office Web Apps WAC Hosting Interaction agw2h Unexpected WOPI Check, non-200 return [code:Forbidden, url:http://sp2013-ca/_vti_bin/wopi.ashx/files/ee46dad3597f414b91d547007d786394] 9bc1abde-e31f-4ec4-9bbc-741b8a169ac6
06/05/2013 23:38:56.21 w3wp.exe (0x1780) 0x258C Office Web Apps WAC Hosting Interaction adhsk Unexpected WOPI CheckFile: Catch-All Failure [exception:Microsoft.Office.Web.Common.EnvironmentAdapters.FileUnknownException: WOPI Check File at Microsoft.Office.Web.Apps.Common.WopiDocument.CheckWopiFile()] 9bc1abde-e31f-4ec4-9bbc-741b8a169ac6
06/05/2013 23:38:56.21 w3wp.exe (0x1780) 0x258C Services Infrastructure Services Infrastructure Logging ai94t Unexpected FileUnknownException while loading the app. [FileSourceId: -1088102096] [ClusterId: 0] [ExtraErrorInfo: ] 9bc1abde-e31f-4ec4-9bbc-741b8a169ac6
06/05/2013 23:44:27.28 w3wp.exe (0x2BC4) 0x1DC4 ULS Logging Unified Logging Service b8fx High ULS Init Completed (w3wp.exe, uls.native.dll)
4. 谷歌这条报错, 发现可能跟AllowOAuthOverHttp的设置有关. 于是follow这篇文章的步骤, 配置AllowOAuthOverHttp.
使用的命令如下:
(Get-SPSecurityTokenServiceConfig).AllowOAuthOverHttp
$config = (Get-SPSecurityTokenServiceConfig)
$config.AllowOAuthOverHttp = $true
$config.Update()
(Get-SPSecurityTokenServiceConfig).AllowOAuthOverHttp
配置之后, 问题解决!
有图有真相.
参考资料
========================
SharePoint 2013 Office Web Apps Problem - Unable to Open/View/Edit
Configure SharePoint 2013 to use Office Web Apps