101 lines
1.2 KiB
Markdown
101 lines
1.2 KiB
Markdown
|
|
Baron SSO에서 Gateway는 Nginx 입니다.
|
|
|
|
정확히는
|
|
|
|
baron_gateway 컨테이너가
|
|
Nginx 기반 Gateway 역할
|
|
을 하고 있습니다.
|
|
|
|
|
|
현재 컨테이너 구조
|
|
|
|
Front
|
|
-----------
|
|
baron_userfront
|
|
baron_adminfront
|
|
baron_devfront
|
|
baron_orgfront
|
|
|
|
Gateway
|
|
-----------
|
|
baron_gateway
|
|
외부 진입점
|
|
|
|
Ory Stack
|
|
-----------
|
|
ory_kratos
|
|
ory_hydra
|
|
ory_keto
|
|
ory_oathkeeper
|
|
|
|
DB
|
|
-----------
|
|
ory_postgres
|
|
baron_postgres
|
|
|
|
|
|
왜 Gateway와 Oathkeeper가 둘 다 있는가?
|
|
Nginx==건물 1층 안내데스크
|
|
Oathkeeper==출입통제 게이트
|
|
|
|
|
|
|
|
Nginx Gateway=baron_gateway="교통정리"담당
|
|
|
|
=URL Routing 역할
|
|
|
|
|
|
/ → UserFront
|
|
|
|
/admin → AdminFront
|
|
|
|
/dev → DevFront
|
|
|
|
/api → Backend
|
|
|
|
/auth → Ory
|
|
|
|
|
|
Oathkeeper=ory_oathkeeper=인증/인가 Gateway
|
|
=사용자 요청=GET /api/user/list
|
|
|
|
|
|
Oathkeeper가 토큰/권한 검사한 후, 있으면 Backend 전달
|
|
없으면
|
|
401
|
|
403 반환
|
|
|
|
|
|
|
|
========================
|
|
사용자의 docker ps 결과로 추정되는
|
|
실제 [로그인]흐름
|
|
|
|
브라우저
|
|
|
|
↓
|
|
|
|
baron_gateway
|
|
|
|
↓
|
|
|
|
baron_userfront
|
|
|
|
↓
|
|
|
|
ory_kratos
|
|
|
|
↓
|
|
|
|
ory_postgres
|
|
|
|
|
|
========================
|
|
SSO 로그인 완료
|
|
ory_hydra : 토큰 발급
|
|
|
|
|
|
|
|
|