Files
document-haness/docs/keycloak-session-store/final/assets/b3-rotation-contention/b3-rotation-contention.alt.md
T

23 lines
1.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 회전 경쟁에서 이긴 요청도 진다
## Alternative text
동시에 도착한 refresh 요청들이 경쟁을 일으키고, 그 결과 client session 자체가 지워지는 구성.
## Long description
revokeRefreshToken 을 켜고 refreshTokenMaxReuse 를 0 으로 둔 상태에서 같은 refresh token 으로 동시에 5건을 보냈다. 순차로 돌리면 재현되지 않으며 백그라운드로 띄우고 wait 해야 경합이 생긴다. 이긴 요청이 받은 새 토큰조차 쓸 수 없었다. Keycloak 이 경쟁을 감지하면 client session 을 지우기 때문이다.
## Elements and evidence
- **동시 refresh 5건** (actor): 같은 refresh token 을 쓴다. Evidence: L776L781.
- **회전 검사** (process): 이미 쓴 토큰인지 본다. Evidence: L776L781.
- **client session** (component): 경쟁이 감지되면 지워진다. Evidence: L789L794.
- **이긴 요청의 새 토큰** (component): 세션이 지워져 쓸 수 없다. Evidence: L789L794.
## Relationships
- **동시 refresh 5건 → 회전 검사:** 동시 도착. Evidence: L776L781.
- **client session → 이긴 요청의 새 토큰:** 사용 불가. Evidence: L789L794.
- **회전 검사 → client session:** 경쟁 감지 시 삭제. Evidence: L789L794.