title: Keep getting 403 forbidden from spring boot example code
body: <p>I followed a simple tutorial for newbie for spring boot and setup my first controller and a few API calls. However, I was able to call GET but the POST always gives me 403 error code from postman and curl. </p>
  
  <p>Here is my relevant code</p>
  
  <pre><code>@Override
      protected void configure(HttpSecurity http) throws Exception {
          http.cors();
      }
  
      @Bean
      CorsConfigurationSource corsConfigurationSource() {
          CorsConfiguration configuration = new CorsConfiguration();
          configuration.setAllowedOrigins(Arrays.asList("*"));
          configuration.setAllowCredentials(true);
          configuration.setAllowedHeaders(Arrays.asList("Access-Control-Allow-Headers","Access-Control-Allow-Origin","Access-Control-Request-Method", "Access-Control-Request-Headers","Origin","Cache-Control", "Content-Type", "Authorization"));
          configuration.setAllowedMethods(Arrays.asList("DELETE", "GET", "POST", "PATCH", "PUT"));
          UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
          source.registerCorsConfiguration("/**", configuration);
          return source;
      }
  </code></pre>
  
  <p>Here is my controller code</p>
  
  <pre><code>@ApiOperation(value = "Create a new order")
      @RequestMapping(value = "/orders", method = RequestMethod.POST, produces = "application/json")
      @ResponseStatus(HttpStatus.CREATED)
      public Order createOrder(
              @ApiParam(value = "New order object", required = true)
              @RequestBody Order newOrder) {
          newOrder.setSymbol(newOrder.getSymbol().toUpperCase());
          return orderRepository.save(newOrder);
      }
  </code></pre>
  
  <p>Here is the http response:</p>
  
  <pre><code>{
      "timestamp": "2019-10-08T19:57:03.487+0000",
      "status": 403,
      "error": "Forbidden",
      "message": "Forbidden",
      "path": "/api/v1/orders"
  }
  </code></pre>
  
  <p>I'm requesting with curl as such</p>
  
  <pre><code>curl --location --request POST "http://localhost:8080/api/v1/orders --data "test"
  </code></pre>
  
  <p><strong>I know its not a CORS issue, I've tried several other auth methods and all of them gives 403 (not 401)</strong></p>