title: reactjs + spring security, registration part failed getting 403 error
body: <pre><code>@Configuration
  public class CorsConfiguration {
  
    @Bean
      public WebMvcConfigurer corsConfigurer() {
          return new WebMvcConfigurer() {
              @Override
              public void addCorsMappings(CorsRegistry registry) {
                  registry.addMapping("/**").allowedMethods("HEAD", "GET", "PUT", "POST", "DELETE", "PATCH").allowedOrigins("*")
                  .allowedHeaders("*");
              }
          };
      }
  </code></pre>
  
  <p>}</p>
  
  <pre><code> @Override
  protected void configure(HttpSecurity http) throws Exception {
  
      http.cors()
      .and().csrf()
      .disable().authorizeRequests().antMatchers("/",
               "/favicon.ico",
               "/**/*.png",
               "/**/*.gif",
               "/**/*.svg",
               "/**/*.jpg",
               "/**/*.html",
               "/**/*.css",
               "/**/*.js")
               .permitAll()
               .antMatchers("/registration", "/login")
               .permitAll().anyRequest()
               .authenticated();;
  }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/KfTZj.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/KfTZj.png" alt="enter image description here"></a></p>
  
  <p>when sending an request from reactjs, I'm getting the error showed in the screenshot. I think it is related to CrossOrigin issue. Please help</p>