1
0
forked from baron/baron-sso

gateway 분리 아키텍처

This commit is contained in:
Lectom C Han
2026-01-30 17:56:42 +09:00
parent 03a78d75ae
commit 9e9c622600
15 changed files with 691 additions and 55 deletions

View File

@@ -37,3 +37,41 @@
2. `/oauth2/auth/requests/login/accept``login_verifier`
3. `/oauth2/auth?client_id=...&login_verifier=...` 호출 → Location 헤더에서 `consent_challenge` 추출
4. `/oauth2/auth/requests/consent/accept` 호출
## 추가 시도 및 결과
### 5) login_verifier를 이용한 consent_challenge 생성 (public /oauth2/auth 호출)
- 시도: `login_verifier``/oauth2/auth?login_verifier=...` 호출 → Location에서 `consent_challenge` 추출 시도
- 실패: `login_verifier has already been used` 또는 `invalid_client` 등으로 예제 redirect(`https://example.com/callback?...`) 에러 반환
- 원인 추정:
- `login_verifier`는 1회성으로, 기존 흐름(redirect_to 또는 consent app)에 의해 이미 사용됨
- `login_verifier`만으로는 client 맥락이 부족하여 invalid_client 발생 가능
### 6) 임시 consent app(127.0.0.1:3000) 없이 redirect_to 직접 호출
- 실패: consent app 미기동으로 연결 불가
- 원인: login/consent UI URL이 기본값(127.0.0.1:3000)이라 실제 서비스 필요
### 7) Python 컨테이너에서 임시 consent app + 클라이언트 플로우 실행
- 방법: python:3.12-alpine 컨테이너에서
- 127.0.0.1:3000에 최소 consent 앱 실행
- `/oauth2/auth` 호출을 따라가며 login/consent 자동 수락
- 결과:
- 첫 시도에서 `state` 길이 부족으로 `invalid_state` 발생
- 이후 `state/nonce` 길이 충분히 늘려 재시도 중
## 현재 결론
- 실제 consent 앱이 없으면 Hydra는 consent_challenge를 만들 수 없고 흐름이 중단됨.
- 임시 consent 앱을 컨테이너 내부에서 띄우는 방식이 가장 현실적이며, 이 흐름으로 계속 진행 중.
### 8) devfront/hydra-rp-dummy.py + docker mount 실행
- 방식: `hydra-rp-dummy.py`를 컨테이너에 마운트하여 임시 consent app(127.0.0.1:3000)으로 로그인/동의 자동 수락
- 결과: 최종 리다이렉트가 `request_forbidden` (CSRF 쿠키 없음) 에러로 종료됨
- 하지만 Hydra Admin 조회 결과 consent 세션은 생성됨
- `handled_at`: 2026-01-30T05:01:46.770699Z
- subject: `22607c1b-bfbf-4a90-9505-36b348472e7a`
- client_id: `52a597f0-5b06-4fcb-b804-93e88a56a75a`
- grant_scope: `openid profile email`
### 상태
- consent 세션 생성 완료(확인됨)
- 최종 리다이렉트 단계에서 CSRF 오류는 남아 있으나, 목적(연동/동의 저장)은 달성됨