码迷,mamicode.com
首页 > 编程语言 > 详细

Spring boot X-Frame-Options 异常 a frame because it set 'X-Frame-Options' to 'deny'

时间:2020-02-08 17:12:56      阅读:74      评论:0      收藏:0      [点我收藏+]

标签:boot   spring   ever   mat   verify   val   cep   options   authorize   

a frame because it set ‘X-Frame-Options‘ to ‘deny‘

在spring security配置的位置添加

http.headers().frameOptions().disable();

    protected void configure(HttpSecurity http) throws Exception {
        http.headers().frameOptions().disable();
        http.authorizeRequests()
                .antMatchers("/login", "/logout", "/getVerifyCode", "/validateVerifyCode")
                .permitAll()
                .anyRequest().authenticated()

                .and()
                .formLogin()
                .loginPage("/login")
                .successForwardUrl("/success")
                .failureForwardUrl("/failure")

                .and()
                .logout()
                .logoutUrl("/logout")
                .invalidateHttpSession(true)

                .and()
                .csrf().disable();
    }

 

Spring boot X-Frame-Options 异常 a frame because it set 'X-Frame-Options' to 'deny'

标签:boot   spring   ever   mat   verify   val   cep   options   authorize   

原文地址:https://www.cnblogs.com/yangchongxing/p/12284022.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!