Skip to content

feat(studio): external-mode OIDC login - #977

Closed
jtenniswood wants to merge 1 commit into
studio/S11from
studio/S12
Closed

feat(studio): external-mode OIDC login#977
jtenniswood wants to merge 1 commit into
studio/S11from
studio/S12

Conversation

@jtenniswood

Copy link
Copy Markdown

Stack 12/21 — Studio: external-mode OIDC login

Sign-in for external-mode daemons behind an OIDC-aware gateway. Almost purely additive; managed mode is untouched.

  • lib/oidc/: PKCE (+RFC 7636 test vector), token store (tokens in process memory only), resolve-authorization — whose ordering suite pins the contract that matters for this stack: OIDC unconfigured ⇒ the static-bearer path is byte-identical, so PRs 3–11's behavior is provably unchanged.
  • lib/oidc-session.ts: discovery cache, PKCE attempt TTL/cap, single-flight refresh, RFC 7009 sign-out.
  • app/api/auth/oidc/[action] (status/start/callback/logout) behind PR 3's requestIsTrusted; escaped postMessage close page; the settings login card (external mode only).
  • The first of two allowlisted server-proxy.ts re-touches: the inline static-token block becomes resolveExternalAuthorization() (~+20/−12 — small because request-trust was extracted in PR 3).
  • .env.example gains the five MECATL_OIDC_* rows — fixing a documented gap in the original branch (the vars existed in code but not in the example file); called out as a deviation.

Demo at this stack point: sign in via the settings card against a real IdP; sign out; managed mode unaffected.

Part of the stacked landing of #618.

🤖 Generated with Claude Code

Sign-in for external-mode daemons behind an OIDC-aware gateway. lib/oidc
carries PKCE (+ the RFC 7636 test vector), the in-memory token store, and
resolve-authorization — whose ordering suite pins the contract that matters
for this series: OIDC unconfigured ⇒ the static-bearer path is byte-
identical, so every earlier PR's behavior is provably unchanged.
lib/oidc-session.ts adds the discovery cache, PKCE attempt TTL/cap,
single-flight refresh, and RFC 7009 sign-out. The auth routes
(status/start/callback/logout) sit behind requestIsTrusted with an escaped
postMessage close page; the settings login card renders in external mode
only.

server-proxy.ts takes its first allowlisted re-touch: the inline
static-token block becomes resolveExternalAuthorization(). .env.example
gains the five MECATL_OIDC_* rows — fixing a documented gap in the original
branch, where the vars existed in code but not in the example file.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@jtenniswood jtenniswood added enhancement New feature or request config Operator settings.yaml / YAML config surface, flags, and config UX (init, reference, enable models) WebUI Applies to the WebUI interface labels Sep 2, 2026
@jhrozek jhrozek closed this Sep 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

config Operator settings.yaml / YAML config surface, flags, and config UX (init, reference, enable models) enhancement New feature or request WebUI Applies to the WebUI interface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants