Files
technical-visualization-haness/.work/keycloak-four-patterns/final/assets/ap3-bff-session-flow/ap3-bff-session-flow.alt.md
T
2026-07-29 18:03:21 +09:00

26 lines
2.0 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.
# AP3 session cookie에서 BFF downstream Bearer까지
## Alternative text
브라우저, BFF, authorized-client store, Resource Server 사이에서 AP3_SESSION 요청, server-held token 조회, downstream Bearer 호출과 중계 JSON이 이어지는 순서도.
## Long description
브라우저가 Authorization header 없이 AP3_SESSION cookie로 /bff/api/me를 호출한다. BFF는 현재 Authentication으로 authorized-client manager를 호출해 server-held access token을 얻고 Resource Server의 /api/me에 Bearer header를 붙인다. Resource Server가 JWT를 검증해 사용자 JSON을 반환하면 BFF가 ResponseEntity로 받아 브라우저에 중계한다. 브라우저 session cookie는 downstream으로 전달되지 않는다.
## Elements and evidence
- **브라우저** (participant): Authorization header 없이 AP3_SESSION cookie로 BFF endpoint를 호출하고 중계 JSON을 받는다. Evidence: L714L722, L750L760, L796L809.
- **Spring BFF** (participant): Session authentication을 authorized client 조회로 바꾸고 Resource Server용 Bearer 요청을 조립한다. Evidence: L750L783, L796L809.
- **Authorized-client store** (participant): Registration과 principal name으로 BFF의 access token과 refresh token을 보관한다. Evidence: L700L712, L762L768.
- **Resource Server** (participant): BFF가 붙인 Bearer JWT를 검증하고 사용자 JSON을 반환한다. Evidence: L776L796.
## Relationships
- **브라우저 → Spring BFF:** GET /bff/api/me + AP3_SESSION. Evidence: L750L760.
- **Spring BFF → Authorized-client store:** authorize current principal. Evidence: L762L768.
- **Authorized-client store → Spring BFF:** server-held access token. Evidence: L762L768.
- **Spring BFF → Resource Server:** GET /api/me · Bearer access token. Evidence: L770L783.
- **Resource Server → Spring BFF:** subject · username · issuer · audience. Evidence: L785L796.
- **Spring BFF → 브라우저:** BFF ResponseEntity → browser JSON. Evidence: L796L809.