2.0 KiB
2.0 KiB
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: L714–L722, L750–L760, L796–L809.
- Spring BFF (participant): Session authentication을 authorized client 조회로 바꾸고 Resource Server용 Bearer 요청을 조립한다. Evidence: L750–L783, L796–L809.
- Authorized-client store (participant): Registration과 principal name으로 BFF의 access token과 refresh token을 보관한다. Evidence: L700–L712, L762–L768.
- Resource Server (participant): BFF가 붙인 Bearer JWT를 검증하고 사용자 JSON을 반환한다. Evidence: L776–L796.
Relationships
- 브라우저 → Spring BFF: GET /bff/api/me + AP3_SESSION. Evidence: L750–L760.
- Spring BFF → Authorized-client store: authorize current principal. Evidence: L762–L768.
- Authorized-client store → Spring BFF: server-held access token. Evidence: L762–L768.
- Spring BFF → Resource Server: GET /api/me · Bearer access token. Evidence: L770–L783.
- Resource Server → Spring BFF: subject · username · issuer · audience. Evidence: L785–L796.
- Spring BFF → 브라우저: BFF ResponseEntity → browser JSON. Evidence: L796–L809.