拒绝在框架中显示,因为祖先违反了以下内容安全策略指令

Refused to display in a frame because an ancestor violates the following Content Security Policy directive

我正在开发一个 salesforce 应用程序,它在 salesforce 页面的 iframe 内呈现。使用 node express 服务器呈现此页面。作为安全审查的一部分,我只想在 salesforce 页面中呈现,如果嵌入到其他任何地方则阻止。

为此,我添加了 content-security-policy header 如下:

response.header("Content-Security-Policy", "frame-ancestors salesforce.com");

但它在 salesforce 页面上也被阻止了。

错误:

Refused to display 'https://localhost:8000/authenticate' in a frame because an ancestor violates the following Content Security Policy directive: "frame-ancestors salesforce.com".*

salesforce 应用程序 url 我的 iframe 正在呈现的位置:https://ap4.salesforce.com/0016F00001vmoMu

我尝试在指令中将域指定为 *.salesforce.com。但是也没用。

谁能帮我看看哪里做错了?

设置此政策使其能够在所有浏览器中呈现

 add_header Content-Security-Policy "frame-src 'self' https://salesforce.com;"

尝试删除 https 并添加子域,例如

add_header Content-Security-Policy "frame-src 'self' www.salesforce.com;"

我试图在一个框架中打开一个完整的页面,修复是标签的目标属性,例如

w3 Schools