Spring Security에서 formLogin()로 사용자가 로그인했을때 HttpSession
Spring Security는 HttpSession을 생성함
SecurityContext가 생성되고 HttpSession에 저장됨

UsernamePasswordAuthenticationToken 에 들어있는 것들
UsernamePasswordAuthenticationToken
[
Principal = org.springframework.security.core.userdetails.User
[ Username=user(로그인했던 ID), Password=[PROTECTED], Enabled=true, AccountNonExpired=true, credentialsNonExpired=true, AccountNonLocked=true, Granted Authorities=[ROLE_USER] ]
, Credentials = [PROTECTED]
, Authenticated = true
, Details = WebAuthenticationDetails
[ RemoteIpAddress=0:0:0:0:0:0:0:1, SessionId=5DC4C1F9E91A9B24A6D1A50B728B7066 ]
, Granted Authorities = [ROLE_USER]
]
SessionId=5DC4C1F9E91A9B24A6D1A50B728B7066 이건 뭘까??
HttpSession의 id값( 이게 쿠키에 있는 JSESSIONID의 Value값 )과는 다름
로그인후 logout() 으로 로그아웃 했을때 HttpSession

HttpSession는 제거됨
'Spring > Spring Security' 카테고리의 다른 글
| Security 메커니즘 (0) | 2024.10.12 |
|---|---|
| UserDetailsService 로 인증처리할때 password (0) | 2024.06.10 |
| MD5형식으로 암호화 (0) | 2024.05.21 |
| Spring Security 쓰는 이유 서치 (0) | 2024.04.18 |
| [Security] 간단한 구현을 위한 정리 (0) | 2022.11.15 |