Disable Spring Security for OPTIONS Http Method

前端 未结 6 2469
自闭症患者
自闭症患者 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:36

    Have you tried this

    You can use multiple elements to define different access requirements for different sets of URLs, but they will be evaluated in the order listed and the first match will be used. So you must put the most specific matches at the top. You can also add a method attribute to limit the match to a particular HTTP method (GET, POST, PUT etc.).

    
        
        
    
    

    Above means you need to select the url pattern to intercept and what methods you want

提交回复
热议问题