我们遇到一个奇怪的问题,从 SharePoint 到 Cognos TM1 URL 的直接链接会导致 403,但如果我们直接刷新或粘贴该链接,它就会起作用。
原因可能与前导“http”被剥离有关(请参见下文其他浏览器的情况),但这在原始 HTML 链接或 Fiddler 结果中并不明显:
对于原因/解决方法有什么想法吗?
从 SharePoint 菜单项中:
GET http://server:9510/tm1web/ HTTP/1.1
Accept: text/html, application/xhtml+xml, */*
Referer: http://portal/Pages/home.aspx
Accept-Language: en-AU
User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)
Accept-Encoding: gzip, deflate
Host: server:9510
Connection: Keep-Alive
结果 [失败]:
HTTP/1.1 403 Forbidden
Server: Apache-Coyote/1.1
Content-Length: 0
Date: Mon, 23 Feb 2015 01:25:29 GMT
出现 403 错误后,在浏览器中按 F5/刷新:
GET http://server:9510/tm1web/ HTTP/1.1
Accept: text/html, application/xhtml+xml, */*
Accept-Language: en-AU
User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)
Accept-Encoding: gzip, deflate
Connection: Keep-Alive
Host: server:9510
Cookie: JSESSIONID=6A01B8265CC22BD13A9DD46575A6485F; DWRSESSIONID=gIilAwYv2K33Yahd$G7keNo4QKk
结果 [作品]:
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Content-Encoding: gzip
Content-Type: text/html;charset=UTF-8
Content-Length: 684
Date: Mon, 23 Feb 2015 01:43:40 GMT
其它浏览器:
- Chrome 也会出现 403 错误 - 但不会在 URL 中显示前导“http” - 这意味着按 F5 不会产生任何影响:
- Firefox 与 Chrome 相同:
我们的解决方法是使用带有页面的非 SharePoint 网络服务器进行重定向(例如 HTML META 重定向)。
我们认为允许XFrameHeaderModule HTTP Module
可能会导致此问题,但在我们的开发服务器上禁用它仍然会导致此问题。
附加示例:
从 SharePointRedirect
页面:
GET http://portal/Pages/TM1-Redirect.aspx HTTP/1.1
Accept: text/html, application/xhtml+xml, */*
Referer: http://portal/Pages/home.aspx
Accept-Language: en-AU
User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)
Accept-Encoding: gzip, deflate
Host: portal
Connection: Keep-Alive
Cookie: ...
结果 #1 - 重定向:
HTTP/1.1 302 Found
Cache-Control: private, max-age=0
Content-Type: text/html; charset=utf-8
Expires: Sun, 08 Feb 2015 01:45:45 GMT
Last-Modified: Mon, 23 Feb 2015 01:45:45 GMT
Location: http://server:9510/tm1web/
Server: Microsoft-IIS/8.0
X-SharePointHealthScore: 0
X-AspNet-Version: 4.0.30319
SPRequestGuid: 9664ec9c-9790-10c2-3b44-67b194daa158
request-id: 9664ec9c-9790-10c2-3b44-67b194daa158
SPRequestDuration: 74
SPIisLatency: 0
WWW-Authenticate: Negotiate ...
Persistent-Auth: true
X-Powered-By: ASP.NET
MicrosoftSharePointTeamServices: 15.0.0.4561
X-Content-Type-Options: nosniff
X-MS-InvokeApp: 1; RequireReadOnly
Date: Mon, 23 Feb 2015 01:45:45 GMT
Content-Length: 146
<html><head><title>Object moved</title></head><body>
<h2>Object moved to <a href="http://server:9510/tm1web/">here</a>.</h2>
</body></html>
结果 #2 - [失败— 同上]:
HTTP/1.1 403 Forbidden
Server: Apache-Coyote/1.1
Content-Length: 0
Date: Mon, 23 Feb 2015 01:45:45 GMT
答案1
要解决此问题,请修改 tm1web_config.xml 文件,如下所示:
改变这个
<add key="CrossDomainAccessList" value="" />
到
<add key="CrossDomainAccessList" value="*" />
并重新启动应用服务器服务。