访问H2控制台时,出现X帧DENY错误,而单独加载时可以完全访问每个帧内容。 我试图禁用标头选项和csrf,但仍然没有成功。
以下是我的安全配置
@Override
protected void configure(HttpSecurity http) throws Exception {
http
.sessionManagement()
.sessionCreationPolicy(SessionCreationPolicy.STATELESS)
.and()
.authorizeRequests()
.antMatchers( "/h2-console/**").permitAll()
.anyRequest().authenticated()
.and()
.httpBasic()
.realmName(securityRealm)
.and()
.headers().frameOptions().disable()
.and()
.csrf().disable()
}