How to disable spring-security login screen?

前端 未结 7 2743
慢半拍i
慢半拍i 2020-12-14 00:23

I\'m using spring-boot-starter-security dependency, to make use of several classes that come with spring-security. But as I want to integrate it in

7条回答
  •  一向
    一向 (楼主)
    2020-12-14 01:19

    Disable the default spring security by excluding it from the autoconfiguration. Add SecurityAutoConfiguration.class to the exclude property of the @SpringBootApplication annotation on your main class. Like follows:

    @SpringBootApplication(exclude = { SecurityAutoConfiguration.class })
    public class MyApplication {
        public static void main(String[] args) {
            SpringApplication.run(MyApplication.class, args);
        }
    }
    

提交回复
热议问题