Spring Boot project shows the Login page

前端 未结 3 1598
闹比i
闹比i 2020-12-29 19:51

I created a Spring boot project with the Spring initializer and only have the starter code so far.

The sample code

@Spring         


        
3条回答
  •  清歌不尽
    2020-12-29 20:40

    That is the default behavior. to change this, you have a few options:

    You can remove the Spring Boot Security dependency:

    
    org.springframework.boot
    spring-boot-starter-security
    
    

    You can desable autoconfiguration. To do so; in your main class, to: @SpringBootApplication append: (exclude = { SecurityAutoConfiguration.class }) so that it looks like:

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

    you can also do this from the application.properties file

    For more information on desableing Auto-Configuration and setting up your own. Reference: Spring Boot Security Auto-Configuration

提交回复
热议问题