为我的 HTTP 请求创建暂存以测试端点,但是由于设置了 Spring Security,我收到了 HTTP/1.1 403 Forbidden
我该如何解决这个问题,我知道每次运行我的项目时 spring security 都会生成一个新 key ,但是也许有一种方法可以让临时文件获取该 key 或其他东西。
谢谢
最佳答案
检查您的WebSecurityConfig
类。我认为您需要像这样配置端点:
protected void configure(HttpSecurity httpSecurity) throws Exception {
httpSecurity.cors();
httpSecurity.csrf().disable();
httpSecurity.authorizeRequests()
.antMatchers(HttpMethod.POST, "/user").permitAll()
.antMatchers(HttpMethod.POST, "/authenticate").permitAll()
//some code
}
关于java - Spring Security + Scratch Java 扩展,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60638681/