如何在iframe中设置keydape登录页面?

如何在iframe中设置keydape登录页面?,iframe,keycloak,hapijs,search-guard,Iframe,Keycloak,Hapijs,Search Guard,有一个web服务器在本地运行,我希望在iframe中有keydepeat(在另一个域上)登录页面。我在KeyClope Real设置>安全防御>标题>内容安全策略中尝试了以下设置 frame-src 'self' http://127.0.0.1 http://192.168.1.140 http://localhost *.home-life.hub http://trex-macbook.home-life.hub localhost; frame-ancestors 'self'; obj

有一个web服务器在本地运行,我希望在iframe中有keydepeat(在另一个域上)登录页面。我在KeyClope Real设置>安全防御>标题>内容安全策略中尝试了以下设置

frame-src 'self' http://127.0.0.1 http://192.168.1.140 http://localhost *.home-life.hub http://trex-macbook.home-life.hub localhost; frame-ancestors 'self'; object-src 'none';
基本上,我将本地IP地址和主机名作为源放入
frame src

登录页面未显示,我在浏览器控制台中遇到此错误

Refused to display 'http://keycloak.example.com:8080/auth/realms/master/protocol/openid-connect/auth?client_id=es-openid&response_type=code&redirect_uri=https%3A%2F%2Fkibana.example.com%3A5601%2Fauth%2Fopenid%2Flogin&state=3RV-_nbW-RvmB8EfUwgkJq&scope=profile%20email%20openid' in a frame because an ancestor violates the following Content Security Policy directive: "frame-ancestors 'self'".
我的自定义标题已存在

我的服务器和UI(服务器呈现)代码:

“严格使用”;
常量Hapi=require('@Hapi/Hapi');
const init=async()=>{
//在所有接口上运行服务器
const server=Hapi.server({
港口:3000,
});
等待server.start();
//server.ext('onPreResponse',(req,h)=>{
//req.response.header('Content-Security-Policy',“default src'self'*.example.com”);
//日志('req.response.headers',req.response.headers);
//返回h.继续;
// });
服务器路由({
方法:“GET”,
路径:'/home',
处理程序:()=>{
返回`
searchguard kibana openid钥匙斗篷

`; }, }); 服务器路由({ 方法:'*', 路径:'/{path*}', 处理程序:(请求,h)=>{ 返回h.redirect('/home'); }, }); console.log('在%s上运行的服务器',Server.info.uri); }; process.on('unhandledRejection',(err)=>{ 控制台日志(err); 过程。退出(1); }); init();
iframe最后应该在kibana.example.com上显示一个页面。KeyClope用作kibana.example.com的身份提供者。

尝试更改:

frame-ancestors 'self';


一般来说,调整CSP配置。

我已经开始运行了,比方说。我将CSP设置为
frame src'self'https://auth.mysite.com; 框住祖先的自我https://auth.mysite.com; 对象src'none'
仍然会出现此错误。我甚至可以在客户端应用程序的网络选项卡下的标题中看到:
Content Security Policy:frame src'self'https://auth.mysite.co.za; 框住祖先的自我https://auth.mysite.co.za; 对象src'none'CSP是您需要更改的全部内容吗?
frame-ancestors 'self';
frame-ancestors 'self' http://127.0.0.1 http://192.168.1.140 http://localhost *.home-life.hub http://trex-macbook.home-life.hub localhost;