From 792917aba6700adf7960b78d6aca186dc18b0f02 Mon Sep 17 00:00:00 2001 From: SDI Date: Tue, 30 Jun 2026 15:05:24 +0900 Subject: [PATCH] =?UTF-8?q?BARON-SSO=20=EB=A1=9C=EA=B7=B8=EC=9D=B8=20?= =?UTF-8?q?=EA=B8=B0=EB=8A=A5=20=EC=97=B0=EB=8F=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env | 4 + docker-compose.prod.yaml | 9 +- docker-compose.test.yaml | 4 +- docker/nginx/default.conf | 10 + index.html | 43 +++ package-lock.json | 95 +++++++ package.json | 1 + server.js | 579 ++++++++++++++++++++++++++++++++++++++ src/main.ts | 215 +++++++++++++- src/styles/login.css | 85 ++++++ src/utils/jwks.js | 96 +++++++ 11 files changed, 1138 insertions(+), 3 deletions(-) create mode 100644 src/utils/jwks.js diff --git a/.env b/.env index a0446e1..09902d8 100644 --- a/.env +++ b/.env @@ -3,4 +3,8 @@ DB_PORT=3306 DB_USER=itam DB_PASS=itam1234 DB_NAME=itam +CLIENT_ID=836cd2e1-995a-4027-bcb5-5dd9c94c2b84 +ISSUER=https://sso.hmac.kr/oidc +REDIRECT_URI=http://172.16.9.44:8080/callback +JWKS_URI=http://172.16.9.44:8080/.well-known/jwks.json PORT=3000 \ No newline at end of file diff --git a/docker-compose.prod.yaml b/docker-compose.prod.yaml index 38910fd..79bcf59 100644 --- a/docker-compose.prod.yaml +++ b/docker-compose.prod.yaml @@ -11,9 +11,13 @@ services: environment: NODE_ENV: production PORT: 3000 + KEYS_PATH: /app/data/keys.json + REDIRECT_URI: ${PROD_REDIRECT_URI:-http://172.16.10.175:9090/callback} + JWKS_URI: ${PROD_JWKS_URI:-http://172.16.10.175:9090/.well-known/jwks.json} volumes: - ./uploads:/app/uploads - ./map_config.json:/app/map_config.json:ro + - backend_keys:/app/data expose: - "3000" restart: unless-stopped @@ -70,4 +74,7 @@ services: restart: always command: - --character-set-server=utf8mb4 - - --collation-server=utf8mb4_unicode_ci \ No newline at end of file + - --collation-server=utf8mb4_unicode_ci + +volumes: + backend_keys: \ No newline at end of file diff --git a/docker-compose.test.yaml b/docker-compose.test.yaml index 4d354dd..ffd9fd9 100644 --- a/docker-compose.test.yaml +++ b/docker-compose.test.yaml @@ -13,11 +13,13 @@ services: environment: NODE_ENV: development PORT: 3000 - DB_HOST: ${DB_HOST:-172.16.8.151} + DB_HOST: ${TEST_DB_HOST:-host.docker.internal} DB_PORT: ${DB_PORT:-3306} DB_USER: ${DB_USER:-root} DB_PASS: ${DB_PASS:-} DB_NAME: ${DB_NAME:-itam} + extra_hosts: + - "host.docker.internal:host-gateway" ports: - "3000:3000" volumes: diff --git a/docker/nginx/default.conf b/docker/nginx/default.conf index 58e44b2..e0e7d40 100644 --- a/docker/nginx/default.conf +++ b/docker/nginx/default.conf @@ -31,6 +31,16 @@ server { application/json application/javascript; gzip_min_length 1000; + # Expose the backend JWKS document for Baron SSO headless login verification. + location = /.well-known/jwks.json { + proxy_pass http://backend/.well-known/jwks.json; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_http_version 1.1; + } + # Forward all app requests to the frontend container location / { proxy_pass http://frontend; diff --git a/index.html b/index.html index dbeaba1..cc38b8a 100644 --- a/index.html +++ b/index.html @@ -14,6 +14,49 @@ + +