1. js方法(不推荐,破解方法很多,而且部分浏览器会阻止页面url的脚本替换)
<script type="text/javascript">
if(self != top) { top.location = self.location; }
</script
2.设置X-Frame-Options响应头
Note:
设置 meta 标签是无效的!例如
<meta http-equiv="X-Frame-Options" content="deny">
没有任何效果。不要这样用!只有当像下面示例那样设置 HTTP 头
X-Frame-Options
才会生效。
https://developer.mozilla.org/zh-CN/docs/Web/HTTP/X-Frame-Options
1. js方法(不推荐,破解方法很多,而且部分浏览器会阻止页面url的脚本替换)<script type="text/javascript"> if(self != top) { top.location = self.location; }</script2.设置X-Frame-Options响应头Note:设置 meta 标签是无效的!例如<...
Refused to display 'http://localhost:8080/xxx' in a
frame
because it set 'X-
Frame
-Options' to 'DENY'
Spring Security4默认是将’X-
Frame
-Options’ 设置为 ‘DENY’ 所以重新配置下SpringSecurity, 在<http>标签内添加配置:
<headers>
<
frame
-options policy="SAMEORIGI
嵌入
第
三方
网站
的i
frame
会根据i
frame
的设置和子
网站
的安全策略,来决定是否允许子
网站
在i
frame
中进行登录。
如果子
网站
设置了合适的安全策略,允许在i
frame
中进行登录,并且没有对跨域请求进行限制,那么子
网站
登录应该是可以成功的。
但是,有些
网站
会采取一些安全措施,例如使用CSP(Content Security Policy)来限制页面资源的加载,或者使用X-
Frame
-Options来
禁止
页面在i
frame
中加载。这些措施可能会影响子
网站
在i
frame
中的登录,甚至可能导致登录失败。
因此,是否能够成功登录取决于子
网站
的设置以及安全策略,并且需要针对具体情况进行具体分析。