23 Commits

Author SHA1 Message Date
Chris Farhood 1f52a254f6 ci: test build on updated runners (retry 2)
build / test (push) Successful in 31s
build / build (push) Successful in 15s
2026-07-07 22:06:17 -04:00
Chris Farhood 9c3d9c8bbc ci: test build on updated runners (retry)
build / test (push) Successful in 30s
build / build (push) Failing after 2s
2026-07-07 22:01:23 -04:00
Chris Farhood e7e5a0ddf4 ci: test build on updated runners
build / test (push) Successful in 29s
build / build (push) Failing after 20s
2026-07-07 21:54:43 -04:00
Chris Farhood 1f6fd7acfe security: allowlist DCR redirect_uri hosts (fixes consent-phishing / account takeover)
build / test (push) Successful in 41s
build / build (push) Successful in 14s
Unauthenticated DCR previously accepted any redirect_uri; combined with the
auto-approving /consent handler an attacker could register a client pointing at
their domain, phish a logged-in user, and silently receive an auth code for the
victim's identity. Reject non-allowlisted redirect_uri hosts at registration
(default: claude.ai, claude.com, and the BETTER_AUTH_URL/portal host).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-07 09:33:24 -04:00
Chris Farhood 0f6f006ea2 ci: rebuild on fresh runner
build / test (push) Successful in 1m27s
build / build (push) Successful in 38s
2026-07-07 08:25:10 -04:00
Chris Farhood dd4fdf880e ci: retrigger build (runner hiccup on prior run)
build / test (push) Failing after 10m37s
build / build (push) Has been skipped
2026-07-07 08:11:54 -04:00
Chris Farhood 46bf005ec3 cleanup: remove DEBUG_EMAIL_PASSWORD email/password backdoor; add MIT LICENSE + .env.example
build / test (push) Failing after 12m52s
build / build (push) Has been skipped
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-07 07:53:53 -04:00
Chris Farhood 534bba3b06 docs: add CLAUDE.md + README
build / test (push) Successful in 9s
build / build (push) Successful in 9s
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-07 07:21:24 -04:00
Chris Farhood 04eadd52b7 auth: validAudiences for the MCP resource (RFC 8707/9068)
build / test (push) Successful in 9s
build / build (push) Successful in 9s
MCP clients send resource=<mcp url>; Better Auth rejected it because the default
allowed audience is only baseURL. List the MCP resource so the token exchange
succeeds and the access token becomes a JWT with aud=resource.
2026-07-06 21:23:37 -04:00
Chris Farhood 46679865e3 auth: env-gated email/password (debug the token exchange headlessly)
build / test (push) Successful in 7s
build / build (push) Successful in 8s
2026-07-06 21:09:46 -04:00
Chris Farhood 63a9553868 auth: strip prompt=consent from initial authorize (auto-approve for connector)
build / test (push) Successful in 7s
build / build (push) Successful in 8s
Claude forces the consent screen with prompt=consent; the consent endpoint's
signed-query round-trip is brittle. Simpler: drop prompt=consent from the initial
unsigned authorize so skipConsent applies and no consent page is shown. Also pass
raw query bytes to the login/consent handlers.
2026-07-06 17:11:52 -04:00
Chris Farhood 462d8c0223 auth: implement /consent auto-approve (Claude sends prompt=consent, forcing it)
build / test (push) Successful in 14s
build / build (push) Successful in 8s
Google login worked; the flow died on the unimplemented consent page. Auto-accept
via auth.api.oauth2Consent with the signed oauth_query + session, then 302 to the
client callback with the code.
2026-07-06 16:53:06 -04:00
Chris Farhood 5d4cc7a122 auth: absolute loginPage/consentPage URLs (relative redirect blanked in Claude)
build / test (push) Successful in 13s
build / build (push) Successful in 7s
2026-07-06 07:00:54 -04:00
Chris Farhood c017499857 ci: retrigger (docker hub TLS timeout on base image pull)
build / test (push) Successful in 9s
build / build (push) Successful in 8s
2026-07-05 23:08:00 -04:00
Chris Farhood cfac41d774 auth: server-side /login redirect to Google (no interactive JS page)
build / test (push) Successful in 10s
build / build (push) Failing after 13s
Claude's OAuth window doesn't run page JS, so the button never fired. Initiate
Google sign-in server-side via auth.api.signInSocial and 302 straight to Google;
after Google, callbackURL returns to /oauth2/authorize and the flow resumes. Pure
redirect chain, no client JS.
2026-07-05 22:59:32 -04:00
Chris Farhood b6c0751687 auth: request tracing + configurable Better Auth log level (debug OAuth flow)
build / test (push) Successful in 14s
build / build (push) Successful in 13s
2026-07-05 22:48:20 -04:00
Chris Farhood 4e49632e23 auth: login page resumes the OAuth authorize flow after sign-in
build / test (push) Successful in 7s
build / build (push) Successful in 6s
Better Auth redirects to the login page with the original signed authorize params;
hand them back to /oauth2/authorize as the post-sign-in callback so a code is
issued (was defaulting to '/', producing a blank page).
2026-07-05 22:39:13 -04:00
Chris Farhood 1a52fba596 auth: seed portal as a stable public+PKCE OIDC client in migrate step
build / test (push) Successful in 7s
build / build (push) Successful in 9s
2026-07-05 22:14:42 -04:00
Chris Farhood 213a2b3583 fix: register jwt() plugin (oauth-provider requires it; else jwt_config error)
build / test (push) Successful in 15s
build / build (push) Successful in 6s
2026-07-05 18:48:03 -04:00
Chris Farhood 5532191ab5 feat: use current @better-auth/oauth-provider (drop deprecated oidc-provider)
build / test (push) Successful in 7s
build / build (push) Successful in 14s
Current OAuth 2.1 provider plugin (versioned with core, 1.6.23). Bundles JWT
(access tokens verifiable at /jwks), DCR via /oauth2/register incl. unauthenticated
registration (MCP clients register before they have creds), skipConsent since
sign-in is the authorization for a personal connector.
2026-07-05 16:38:57 -04:00
Chris Farhood 8e67f1d4e2 db: use shared default schema (no separate-schema bootstrap needed)
build / test (push) Successful in 13s
build / build (push) Successful in 5s
2026-07-05 16:25:09 -04:00
Chris Farhood f88687c182 fix: pin better-auth 1.6.23, drop stale CLI, programmatic migrations, fix CI
build / test (push) Successful in 20s
build / build (push) Successful in 14s
- Explicitly track latest core (1.6.23); the @better-auth/cli lags at 1.4.21 and
  pulled a second core copy — replaced with a getMigrations() script on the same
  version (src/migrate.ts).
- CI build job matches the proven pattern (no setup-buildx; plain build/push).
2026-07-05 16:20:40 -04:00
Chris Farhood f47d873262 feat: Better Auth OAuth/OIDC server for the Intervals.icu MCP product
build / test (push) Successful in 20s
build / build (push) Failing after 29s
DCR-capable (RFC 7591) OAuth authorization server so Claude's MCP connector
self-registers — the thing Authentik can't do until 2026.8.0. Users sign in with
Google/Apple; oidcProvider + jwt issue asymmetric JWTs (JWKS) the MCP server
verifies. Shares the existing CNPG Postgres (own `betterauth` schema).

Scaffold: auth config, minimal Node server + login page, Dockerfile, CI.
2026-07-05 16:14:32 -04:00