Sublime Forum

After Spring Boot migration POST requests all throwing 403 error

#1

I have migrated from Spring boot 1.5.1.RELEASE to 2.7.1. In our project CSRF enabled, CORS enabled in 1.5.1.RELEASE too. same configurations are added here. After server start up, Able to login, Do all the GET operations, Not able to do the POST operations:

Error: Invalid CORS request. 2. 403 response code.

Tried few below things:

  1. http.cors().disabled();
  2. In class WebConfig extends WebMvcConfigurerAdapter; registry added registry.addMapping("/**").allowedOrigins(" “).allowedMethods(“POST”,“OPTIONS”).allowCredentials(true).allowedHeaders(” ");
  3. http.forlogin, even permitted all.
  4. This issue is in only QA region, in local and DEV region. code is working fine.
  5. application.yml file, no much changes for the cors: cors: allow-origins: site url;

I have reverted back the code to 1.5.1.RELEASE code is working fine.

How to resolve the issue.No logs with error.

0 Likes

#2

This has nothing to do with Sublime Text. I suggest asking on a general help forum like stack overflow or something more specific to spring boot.

0 Likes