WEB/Security

Lesson 1 - The basic contracts in Spring Security architecture

Tony Lim 2022. 5. 5. 14:35

UserDetailsService provide user infromation from databse like id, pw

pw is encrypted by PasswordEncoder

AuthenticationPrvoider use UserDetailService and PasswordEncoder to authenticate

Authentication details are stored in SecurityContext

 

default Filter

notice , just like diagram , Inside a Filter AuthenticationManager authenticate and then set the result to SecurityContextHolder

 

we only gave UserDetailService then Spring complains that we didn't give proper PasswordEncoder

always need to give both of them