0

Creating scratches for my HTTP requests to test endpoints , however since spring security is set I am getting HTTP/1.1 403 Forbidden

How can i solve this, I know every time I run my project spring security generates a new key, however maybe there is a way for scratch file to get that key or something.

Thank you

1 Answers1

1

Check your WebSecurityConfig Class. I think you need configure your endpoints like this:

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
}