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

2.1 KiB
Raw Blame History

AP2 server-held token에서 브라우저 Bearer 요청까지

Alternative text

브라우저, Spring mediator, authorized-client store, Resource Server 사이에서 AP2_SESSION 요청, access-only 응답, 브라우저 Bearer 호출과 JSON 응답이 이어지는 순서도.

Long description

브라우저가 AP2_SESSION cookie와 함께 /token/access를 Spring mediator에 요청한다. Mediator는 현재 principal과 keycloak registration으로 authorized-client store에서 token을 조회하고 access token, type, expiry만 응답한다. 브라우저는 access token을 지역 변수로 받아 Authorization Bearer header를 만들고 Resource Server의 /api/me를 직접 호출한 뒤 사용자 JSON을 받는다. Refresh token은 브라우저 응답에 포함되지 않는다.

Elements and evidence

  • 브라우저 (participant): AP2_SESSION으로 access endpoint를 호출하고 반환된 access token으로 Resource Server를 직접 호출한다. Evidence: L505L511, L558L586.
  • Spring mediator (participant): 현재 principal로 authorized client를 조회하고 access token, type, expiry만 JSON으로 반환한다. Evidence: L503L540.
  • Authorized-client store (participant): Registration과 principal name으로 access token과 refresh token을 보관하는 process-local service. Evidence: L445L457, L513L521.
  • Resource Server (participant): 브라우저가 만든 Bearer JWT를 검증하고 /api/me 사용자 JSON을 반환한다. Evidence: L571L599.

Relationships

  • 브라우저 → Spring mediator: GET /token/access + AP2_SESSION. Evidence: L503L511.
  • Spring mediator → Authorized-client store: authorize current principal. Evidence: L513L521.
  • Authorized-client store → Spring mediator: current access token. Evidence: L513L521.
  • Spring mediator → 브라우저: access token + type + expiry. Evidence: L523L540.
  • 브라우저 → Resource Server: GET /api/me · browser-created Bearer. Evidence: L558L588.
  • Resource Server → 브라우저: subject · username · issuer · audience. Evidence: L590L615.