필자의 경우 데이터를 프론트에서 JSON으로 받아왔기 때문에 데이터에 가공을 해야 했다.
ObjectMapper를 이용해 JSON으로 받아온 데이터를 다시 Stirng username과 password로 변경해서 토큰을 받을해
Authentication에 저장했다. 즉 Authentication은 사용자가 입력한 값을 저장하게 된 메소드이다.
이를 통해 후에 보게 될 UserDetailService를 통해서 DB조회 후 아이디와 비밀번호를 체크한다.

'Spring_SpringBoot > 코드' 카테고리의 다른 글
| [ Spring Security 6 ] - 6, SuccessHandler, FailerHandler (0) | 2024.07.07 |
|---|---|
| [ Spring Security 6 ] - 5, AuthenticationProvider, UserDetailService, UserDetail (0) | 2024.07.07 |
| [ Spring Security 6 ] - 3 , AccessDeniedHandler, AuthenticationEntryPoint (0) | 2024.07.07 |
| [ Spring Security 6 ] - 2 , SecurityConfig (0) | 2024.07.07 |
| [ Spring Security 6 ] - 1 (0) | 2024.07.07 |