I created a Spring boot project with the Spring initializer and only have the starter code so far.
The sample code
@Spring
if you really want to disable this login page you may disable your class where is:
public class SecurityConfig extends WebSecurityConfigurerAdapter {
this class is not necessary
in my opinion you haven't create this class whose extends WebSecurityConfigurerAdapter
If you don't want login page (from Spring-Security) remove the following dependency from your pom.xml
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
Or if you want to use the Spring-Security then on console it will display the default password like below :
Using default security password: ce6c3d39-8f20-4a41-8e01-803166bb99b6
the default username will be user
That is the default behavior. to change this, you have a few options:
You can remove the Spring Boot Security dependency:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
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