Skip to content

Remote mecatui OIDC login: enrolment, refresh, recovery, and logout #790

Closed
1 of 1 issue completed

Description

@jhrozek

Parent: #437

Summary

mecatui connecting to a remote mecated/mecak8s deployment had no supported
identity story: connect was a bare dial with an optional static --auth-token,
with no enrolment, no credential persistence, no refresh, and no recovery from an
expired or rejected session. Add that story end to end: enrolment, storage,
refresh, in-TUI recovery, and removal.

This is one piece of #437's "trust mecatl in production" story — a demonstrable
Kubernetes deployment needs a login flow that survives longer than one access
token.

Delivered

Four ADRs, each landing a layer:

  • ADR 0242 —
    mecatui login ADDRESS (public-client Authorization Code + PKCE, explicit
    issuer/client id/audience/CA), mecatui logout ADDRESS, and connect staying
    a pure dial that never opens a browser or guesses an issuer. Target-bound
    credentials in a keyring-wrapped encrypted store, separate from the ToolHive
    LLM gateway's mecatui llm login. A scoped private-HTTPS transport
    (authn/oidc/scopedhttps) for a private-CA issuer.
  • ADR 0239
    — proactive refresh gated on client activity, not a wall-clock timer, so an
    idle session still honors the identity provider's configured SSO idle timeout
    instead of silently overriding it.
  • ADR 0240 — a
    closed, proto-free auth-failure taxonomy routed to the existing /connect
    overlay instead of exiting the process; a rejected bearer is never offered
    re-login (re-authenticating would mint an identical token and loop forever);
    session adoption after re-auth defers to the server's own ownership checks
    rather than comparing principals client-side.
  • ADR 0241 — target
    logout that removes the credential before the registry entry (so a partial
    failure can never orphan a credential the registry can no longer find), with
    bounded best-effort RFC 7009 revocation at the provider.

Also fixed along the way

Bugs found while qualifying this against a live Keycloak/Kind fixture, filed and
tracked separately:

Verification

Offline: task lint, task test, task docs:check all green on the feature
branch. Live: qualified against a disposable Kind fixture (mecak8s + Keycloak) —
enrolment, connect, a rejected-bearer recovery, an expired-credential recovery,
and the activity-gated refresh surviving an active session across its access
token's lifetime while a fully idle session correctly expires at the identity
provider's SSO idle timeout.

Out of scope

  • Remote MCP server OAuth provisioning through the mecatl API (Support MCP OAuth provisioning for remote clients #740 — a
    different direction: server-side credential provisioning for a remote caller,
    not mecatui's own login to mecated).
  • Pruning a credential left behind by a since-deleted registry entry — the
    credential store has no enumeration capability; noted as a follow-up in
    ADR 0241, not blocking.

Sub-issues

Sub-issues

1 of 1 Issues completed
Loading 1 sub-issues
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions