为测试端点的HTTP请求创建划痕,但是,由于设置了spring安全性,我得到的是HTTP/1.1403禁止
我该如何解决这个问题呢?我知道每次我运行我的项目spring security都会生成一个新的密钥,但是也许有一种方法可以让临时文件获得这个密钥或其他东西。
谢谢
发布于 2020-03-11 23:08:52
检查您的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
}https://stackoverflow.com/questions/60638681
复制相似问题