- Add the following Spring Security starter dependency to your
build.gradle
file
dependencies {
...
implementation 'org.springframework.boot:spring-boot-starter-security'
}
- Restart your application. You will see ALL HTTP endpoints are protected with a basic login page by default.
- The default username is
user
and the default password is printed to the console e.g.
2020-11-18 21:26:09.144 INFO 33929 --- [main] .s.s.UserDetailsServiceAutoConfiguration : Using generated security password: 9d3593b1-ce46-4de5-895f-abce86bb878c