- Created a Spring app with Spring Initializr.
- Added the Spring Boot Starter Web. Spring Boot Starter Test comes automatically. See
build.gradle
. - Create a
@RestController
-HomeResource.java
- Build and run.
./gradlew build bootrun
- Go to
localhost:8080
in a web browser. - Notice no authentication is required to view the page.
- In
gradle.build
add Spring Boot Starter Security. - Build and run.
./gradlew build bootrun
- Go to
localhost:8080
in a web browser. - See the redirect to a form login page.
- Notice in the Spring log output shows a DefaultSecurityFilterChain was added. A generated