Set up Spring Security & implement (chapter 8 ⭐)

Spring Security

Starting Hello Spring Security Boot

Running Spring Boot Application

`$ ./mvn spring-boot:run ... INFO 23689 --- [ restartedMain] .s.s.UserDetailsServiceAutoConfiguration :

Using generated security password: 8e557245-73e2-4286-969a-ff57fe326336

...`

Spring Boot Auto Configuration

Spring Boot automatically: • Enables Spring Security’s default configuration, which creates a servlet Filter as a bean named springSecurityFilterChain. This bean is responsible for all the security (protecting the application URLs, validating submitted username and passwords, redirecting to the login form, and so on) within your application.

• Creates a UserDetailsService bean with a username of user and a randomly generated password that is logged to the console.

• Registers the Filter with a bean named springSecurityFilterChain with the Servlet container for every request.

xem thêm:

Hello Spring Security :: Spring Security

Architecture

We build on this high-level understanding within the AuthenticationAuthorization, and Protection Against Exploits sections of the reference.