Spring Security: Java Config: How to add the method type?

后端 未结 1 926
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-11 09:32

I\'m using Spring Securitys Java Config.

Want to translate the following XML:



        
相关标签:
1条回答
  • 2021-01-11 09:51

    If you'd check the documentation of antMatchers method, you will see that enumeration of HttpMethod can be passed as the first parameter.

    So something like this should work:

    http.authorizeUrls().antMatchers(HttpMethod.POST, "/login").permitAll();
    
    0 讨论(0)
提交回复
热议问题