spring-security拦截iframe中的html

情景:spring security已经登录了,直接访问http://localhost:8080/test.html也没问题,但是放到iframe里面就被拒绝请求了。

localhost拒绝了请求

解决方法:

<http auto-config="true" use-expressions="false" >
 ...就不写出来了
加上下面这段就OK    
​​​​​​​<!--解决frame请求被拒绝的问题-->
   <headers>
      <frame-options disabled="true"></frame-options>
   </headers>
</http

网上还有种<security:http 标签的,也是一样:

<security:http auto-config="true" use-expressions="true">
    <security:headers>
        <security:frame-options disabled="true"/>
    </security:headers>
</security:http>

猜你喜欢

转载自blog.csdn.net/x18094/article/details/105930681