Skip to content

Commit a32991d

Browse files
committed
Add OIDC Session Management component and Docker development setup
Implement OpenID Connect Session Management 1.0 specification in the test Relying Party application with a new SessionMonitor Svelte component that: - Monitors authentication session state using the OIDC provider's check_session_iframe endpoint - Periodically checks session status every 5 seconds via postMessage communication with hidden iframe - Detects session changes (e.g., logout in another tab) and alerts users in real-time - Displays comprehensive session information including session state, client ID, monitoring status, and last check time - Handles discovery document fetching and validates provider support for session management - Provides detailed UI feedback for various states (authenticated, discovery errors, unsupported providers, missing session state) Enhance Docker development environment with: - Multi-stage Dockerfile using Node 22 and pnpm for development - docker-compose.yml setup with Cloudflare tunnel service for public URL access - Environment variable configuration for PUBLIC_HOST to support public deployments - Vite server configuration to allow configurable hosts for development Update environment configuration to support public hosting scenarios and remove debug logging from layout component.
1 parent 2e3656d commit a32991d

File tree

6 files changed

+632
-15
lines changed

6 files changed

+632
-15
lines changed

tests/app/rp/.env.example

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Set this if you want to run this on a public URL
2+
# PUBLIC_HOST=localhost
3+
14
# OAuth Configuration
25
# OIDC Issuer URL (Identity Provider endpoint)
36
PUBLIC_OIDC_ISSUER=http://localhost:8000/o

tests/app/rp/Dockerfile

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,23 @@
1-
FROM node:18-alpine AS builder
1+
FROM node:22-alpine AS base
22
WORKDIR /app
33
COPY package*.json .
4+
5+
6+
FROM base AS builder
47
RUN npm ci
58
COPY . .
69
RUN npm run build
710
RUN npm prune --production
811

9-
FROM node:18-alpine
12+
FROM node:22-alpine
1013
WORKDIR /app
1114
COPY --from=builder /app/build build/
1215
COPY --from=builder /app/node_modules node_modules/
1316
COPY package.json .
1417
EXPOSE 3000
1518
ENV NODE_ENV=production
16-
CMD [ "node", "build" ]
19+
CMD [ "node", "build" ]
20+
21+
FROM base AS dev
22+
RUN npm install -g pnpm
23+
RUN pnpm install

tests/app/rp/docker-compose.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
services:
2+
cloudflared:
3+
image: cloudflare/cloudflared
4+
user: root:root
5+
command: tunnel run ${APP_CLOUDFLARE_TUNNEL_ID}
6+
networks:
7+
- default
8+
- internal
9+
10+
environment:
11+
TUNNEL_TOKEN: ${APP_CLOUDFLARE_TUNNEL_TOKEN}
12+
13+
frontend:
14+
user: "${UID:-1000}:${GID:-1000}"
15+
build:
16+
context: ./
17+
target: dev
18+
restart: unless-stopped
19+
networks:
20+
- internal
21+
command: pnpm run dev --host
22+
healthcheck:
23+
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:5173"]
24+
interval: 30s
25+
timeout: 10s
26+
retries: 3
27+
28+
volumes:
29+
- "./:/app"
30+
31+
env_file:
32+
- .env
33+
34+
networks:
35+
internal:

0 commit comments

Comments
 (0)