Skip to content

Commit 7688ff2

Browse files
peppescgclaude
andauthored
fix: hardcode OIDC_PROVIDER_ID to oidc (#497)
* Hardcode OIDC_PROVIDER_ID to "oidc" The providerId is Better Auth's internal identifier used in the OAuth2 callback URL path (e.g., /api/auth/oauth2/callback/oidc). It is not related to any specific identity provider (Okta, Auth0, etc.) and has no reason to vary between deployments. Hardcoding it to "oidc" simplifies configuration and makes the redirect URI predictable for all customers, removing one env var that was confusing and unnecessary. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Use static "Sign in" button text instead of provider name The sign-in button was deriving its text from OIDC_PROVIDER_ID (showing "Oidc" after hardcoding). Replace with static "Sign in" text and remove the Okta icon, matching the enterprise implementation. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Fix hono and postcss transitive vulnerabilities via pnpm overrides - hono: ^4.12.12 → >=4.12.14 (GHSA-458j-xx4x-4375, HTML injection in JSX SSR) - postcss: added >=8.5.10 override (GHSA-qx2v-qp2m-jg93, XSS via </style>) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Remove dead OktaIcon component Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Fix E2E fixture sign-in button selector Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Add explanatory comment for hardcoded OIDC_PROVIDER_ID Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent f61c1f3 commit 7688ff2

19 files changed

Lines changed: 39 additions & 103 deletions

File tree

.env.example

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@ OIDC_CLIENT_ID=
1515
# OAuth2 Client Secret from your OIDC provider
1616
OIDC_CLIENT_SECRET=
1717

18-
# OIDC Provider identifier (e.g., "okta", "auth0", "oidc")
19-
OIDC_PROVIDER_ID=
20-
2118
# Better Auth Configuration
2219
# Secret key for token encryption (generate with: openssl rand -base64 32)
2320
BETTER_AUTH_SECRET=
@@ -48,7 +45,6 @@ API_BASE_URL=
4845
# OIDC_ISSUER_URL=http://localhost:3001
4946
# OIDC_CLIENT_ID=web-client
5047
# OIDC_CLIENT_SECRET=web-secret
51-
# OIDC_PROVIDER_ID=oidc
5248
# BETTER_AUTH_URL=http://localhost:3000
5349
# API_BASE_URL=http://localhost:9090
5450

.github/workflows/e2e.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ jobs:
2222
OIDC_ISSUER_URL: http://localhost:4000
2323
OIDC_CLIENT_ID: test-only-not-a-real-id
2424
OIDC_CLIENT_SECRET: test-only-not-a-real-secret
25-
OIDC_PROVIDER_ID: oidc
2625
BETTER_AUTH_URL: http://localhost:3000
2726
BETTER_AUTH_SECRET: test-only-not-a-real-better-auth-secret
2827
USE_E2E_MODEL: "true"
@@ -72,7 +71,6 @@ jobs:
7271
env:
7372
# These env vars must match the runtime values for token encryption/decryption to work
7473
BETTER_AUTH_SECRET: test-only-not-a-real-better-auth-secret
75-
OIDC_PROVIDER_ID: oidc
7674

7775
- name: Run Playwright tests
7876
run: pnpm test:e2e

AGENTS.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,6 @@ pnpm generate-client # Fetch swagger.json and regenerate
331331
- `OIDC_ISSUER_URL` - OIDC provider URL
332332
- `OIDC_CLIENT_ID` - OAuth2 client ID
333333
- `OIDC_CLIENT_SECRET` - OAuth2 client secret
334-
- `OIDC_PROVIDER_ID` - Provider identifier (e.g., "okta", "oidc") - **Required**, server-side only.
335334
- `BETTER_AUTH_URL` - Application base URL
336335
- `BETTER_AUTH_SECRET` - Secret for token encryption
337336

CLAUDE.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,6 @@ git push origin v0.x.x
298298
- `OIDC_ISSUER_URL` - OIDC provider URL
299299
- `OIDC_CLIENT_ID` - OAuth2 client ID
300300
- `OIDC_CLIENT_SECRET` - OAuth2 client secret
301-
- `OIDC_PROVIDER_ID` - Provider identifier (e.g., "okta", "oidc") - Required, server-side only.
302301
- `BETTER_AUTH_URL` - Application base URL
303302
- `BETTER_AUTH_SECRET` - Secret for token encryption
304303

Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,6 @@ kind-setup: kind-create kind-deploy
192192
## OIDC_ISSUER_URL=https://your-org.okta.com
193193
## OIDC_CLIENT_ID=your-client-id
194194
## OIDC_CLIENT_SECRET=your-client-secret
195-
## OIDC_PROVIDER_ID=okta
196195
## BETTER_AUTH_SECRET=your-secret
197196
compose-up:
198197
@echo "Starting full stack (UI + Registry Server)..."

README.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,6 @@ pnpm dev:mock-server
235235
OIDC_ISSUER_URL=https://your-oidc-provider.com
236236
OIDC_CLIENT_ID=your-client-id
237237
OIDC_CLIENT_SECRET=your-client-secret
238-
OIDC_PROVIDER_ID=okta # or your provider
239238
BETTER_AUTH_SECRET=your-secret
240239
BETTER_AUTH_URL=http://localhost:3000
241240
```
@@ -263,7 +262,6 @@ pnpm dev:next
263262
OIDC_ISSUER_URL=https://your-oidc-provider.com
264263
OIDC_CLIENT_ID=your-client-id
265264
OIDC_CLIENT_SECRET=your-client-secret
266-
OIDC_PROVIDER_ID=okta
267265

268266
# Real backend API
269267
API_BASE_URL=https://your-backend-api.com
@@ -323,7 +321,6 @@ See [`docs/mocks.md`](./docs/mocks.md) for details.
323321
| `OIDC_ISSUER_URL` | OIDC provider's issuer URL | `https://auth.example.com` |
324322
| `OIDC_CLIENT_ID` | OAuth2 client ID | `your-client-id` |
325323
| `OIDC_CLIENT_SECRET` | OAuth2 client secret | `your-client-secret` |
326-
| `OIDC_PROVIDER_ID` | Provider identifier | `okta`, `auth0`, `oidc` |
327324
| `BETTER_AUTH_SECRET` | Secret for token encryption | Generate with `openssl rand -base64 32` |
328325
| `BETTER_AUTH_URL` | Application base URL | `https://your-app.example.com` |
329326
| `API_BASE_URL` | Backend API URL | `https://api.example.com` |
@@ -347,7 +344,6 @@ NODE_ENV=development
347344
OIDC_ISSUER_URL=http://localhost:3001
348345
OIDC_CLIENT_ID=web-client
349346
OIDC_CLIENT_SECRET=web-secret
350-
OIDC_PROVIDER_ID=oidc
351347
BETTER_AUTH_URL=http://localhost:3000
352348
API_BASE_URL=http://localhost:9090
353349
```
@@ -425,7 +421,6 @@ git clone https://github.com/stacklok/toolhive-registry-server.git ../toolhive-r
425421
OIDC_ISSUER_URL=https://your-org.okta.com
426422
OIDC_CLIENT_ID=your-client-id
427423
OIDC_CLIENT_SECRET=your-client-secret
428-
OIDC_PROVIDER_ID=okta # or: azure-ad, auth0, oidc
429424
```
430425

431426
2. Start the stack:
@@ -451,7 +446,6 @@ To use an external backend API instead of the local registry-server, add `API_BA
451446
OIDC_ISSUER_URL=https://your-org.okta.com
452447
OIDC_CLIENT_ID=your-client-id
453448
OIDC_CLIENT_SECRET=your-client-secret
454-
OIDC_PROVIDER_ID=okta
455449

456450
# Override local registry-server with external API
457451
API_BASE_URL=https://api.toolhive.example.com

dev-auth/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,5 @@ Replace this with a real OIDC provider (Okta, Keycloak, Auth0, etc.) by updating
5353
- `OIDC_ISSUER_URL` - OIDC provider URL
5454
- `OIDC_CLIENT_ID` - OAuth2 client ID
5555
- `OIDC_CLIENT_SECRET` - OAuth2 client secret
56-
- `OIDC_PROVIDER_ID` - Provider identifier (e.g., "okta", "oidc") - **Required**, server-side only.
5756
- `BETTER_AUTH_URL` - Application base URL (e.g., `http://localhost:3000`)
5857
- `BETTER_AUTH_SECRET` - Secret for token encryption

docker-compose.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
# # OIDC_ISSUER_URL=https://your-org.okta.com
1212
# # OIDC_CLIENT_ID=your-client-id
1313
# # OIDC_CLIENT_SECRET=your-client-secret
14-
# # OIDC_PROVIDER_ID=okta
1514
# # BETTER_AUTH_SECRET=your-secret
1615
# # API_BASE_URL=http://toolhive-registry-api:8080 (optional, default shown)
1716
# docker compose up --build
@@ -98,7 +97,6 @@ services:
9897
- OIDC_ISSUER_URL=${OIDC_ISSUER_URL:-http://localhost:4000}
9998
- OIDC_CLIENT_ID=${OIDC_CLIENT_ID:-better-auth-dev}
10099
- OIDC_CLIENT_SECRET=${OIDC_CLIENT_SECRET:-dev-secret-change-in-production}
101-
- OIDC_PROVIDER_ID=${OIDC_PROVIDER_ID:-okta}
102100
# Database for session storage (handles large OIDC tokens like Azure AD)
103101
- DATABASE_URL=postgresql://auth:auth@toolhive-auth-db:5432/auth
104102
networks:

package.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
"lint": "biome check",
1414
"format": "biome format --write",
1515
"test": "vitest",
16-
"test:e2e": "BETTER_AUTH_SECRET=e2e-test-secret-at-least-32-chars-long OIDC_PROVIDER_ID=okta BETTER_AUTH_RATE_LIMIT=100 pnpm build && playwright test",
17-
"test:e2e:ui": "BETTER_AUTH_SECRET=e2e-test-secret-at-least-32-chars-long OIDC_PROVIDER_ID=okta BETTER_AUTH_RATE_LIMIT=100 pnpm build && playwright test --ui",
18-
"test:e2e:debug": "BETTER_AUTH_SECRET=e2e-test-secret-at-least-32-chars-long OIDC_PROVIDER_ID=okta BETTER_AUTH_RATE_LIMIT=100 pnpm build && playwright test --debug",
16+
"test:e2e": "BETTER_AUTH_SECRET=e2e-test-secret-at-least-32-chars-long BETTER_AUTH_RATE_LIMIT=100 pnpm build && playwright test",
17+
"test:e2e:ui": "BETTER_AUTH_SECRET=e2e-test-secret-at-least-32-chars-long BETTER_AUTH_RATE_LIMIT=100 pnpm build && playwright test --ui",
18+
"test:e2e:debug": "BETTER_AUTH_SECRET=e2e-test-secret-at-least-32-chars-long BETTER_AUTH_RATE_LIMIT=100 pnpm build && playwright test --debug",
1919
"start:e2e": "concurrently -n \"OIDC,Mock,Next\" -c \"blue,magenta,green\" \"pnpm oidc\" \"pnpm mock:server\" \"pnpm start\"",
2020
"test:coverage": "vitest run --coverage",
2121
"type-check": "tsc --noEmit",
@@ -116,7 +116,7 @@
116116
"express-rate-limit": ">=8.2.2",
117117
"lodash": ">=4.17.23",
118118
"lodash-es": ">=4.17.23",
119-
"hono": "^4.12.12",
119+
"hono": ">=4.12.14",
120120
"@hono/node-server": "^1.19.13",
121121
"defu": "^6.1.5",
122122
"rollup": ">=4.59.0",
@@ -126,7 +126,8 @@
126126
"qs": ">=6.14.2",
127127
"yaml": ">=2.8.3",
128128
"path-to-regexp@>=8.0.0 <8.4.0": "8.4.0",
129-
"path-to-regexp@>=0.1.0 <0.1.13": "0.1.13"
129+
"path-to-regexp@>=0.1.0 <0.1.13": "0.1.13",
130+
"postcss": ">=8.5.10"
130131
}
131132
}
132133
}

playwright.config.mts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ export default defineConfig({
4545
OIDC_ISSUER_URL: "http://localhost:4000",
4646
OIDC_CLIENT_ID: "better-auth-dev",
4747
OIDC_CLIENT_SECRET: "dev-secret-change-in-production",
48-
OIDC_PROVIDER_ID: "okta",
4948
BETTER_AUTH_URL: "http://localhost:3000",
5049
BETTER_AUTH_SECRET: "e2e-test-secret-at-least-32-chars-long",
5150
// Better Auth rate limits sign-in to 3 requests per 10 seconds by default.

0 commit comments

Comments
 (0)