Disable Spring Security for OPTIONS Http Method

前端 未结 6 2462
自闭症患者
自闭症患者 2020-11-27 13:37

Is it possible to disable Spring Security for a type of HTTP Method?

We have a Spring REST application with services that require Authorization token to be attached

6条回答
  •  栀梦
    栀梦 (楼主)
    2020-11-27 14:12

    In some cases, it is needed add configuration.setAllowedHeaders(Arrays.asList("Content-Type")); to corsConfigurationSource() when using WebSecurityConfigurerAdapter to solve the cors problem.

提交回复
热议问题