Skip to main content
← Back to list
01Issue
FeatureShippedSwamp CLI
Assigneesstack72

Relationships

#1026 docs: OAuth authentication how-to and explanation guides for swamp serve

Opened by stack72 · 7/7/2026· Shipped 7/8/2026

Parent

Related to #662 (serve authentication & authorization) and #679 (swamp serve user guide).

Summary

Add two new documentation pages covering the OAuth authentication flow for swamp serve. These extend the existing user guide from #679 with the OAuth mode added in #1015 (swamp-club) and #1016 (swamp).

Pages to create

How-to: Set up OAuth authentication

Location: `content/manual/how-to/swamp-serve/set-up-oauth-auth.md`

Covers:

  • Starting swamp serve with OAuth mode: ```bash swamp serve --auth-mode oauth --admins swampadmin --allowed-collectives acme-corp ```

  • First-time bootstrap flow: server displays a verification code, admin approves in browser, client registered automatically, credentials stored in vault. Subsequent starts skip this.

  • User login: ```bash swamp auth server-login --server wss://swamp-serve.example.com ``` User visits the verification URL, signs into swamp-club, enters code, approves. Token stored automatically.

  • Collective-based admission: only users in `--allowed-collectives` can connect. Users not in the allowed collectives are rejected with a clear message.

  • `--allowed-collectives` vs `--allowed-users`: at least one is required for OAuth mode. `--allowed-collectives` checks swamp-club collective membership. `--allowed-users` allows specific user subs.

  • Admin resolution: `--admins` accepts swamp-club usernames (not raw IDs). Resolved automatically at startup via swamp-club.

  • Subsequent starts: credentials loaded from vault, admin resolution uses cached mappings, no browser interaction needed.

  • HTTPS requirement: `--oauth-provider` must be HTTPS except for localhost development.

  • Comparison with mode: token: token mode is for air-gapped environments or teams without swamp-club. OAuth mode is for teams using swamp-club as their identity provider.

Explanation: OAuth and collective-based admission

Location: `content/manual/explanation/swamp-serve.md` (add a new section to the existing explanation page)

Covers:

  • Why OAuth: replaces manual token minting with self-service login. Users authenticate themselves through swamp-club. No tokens to distribute.

  • The device grant flow (RFC 8628): why device grant (CLI + browser on different machines), how it works (code displayed in terminal, user approves in browser, CLI polls until approved), why it's the standard for CLI tools (GitHub CLI, Claude Code use the same pattern).

  • The bootstrap client: a well-known public client ID baked into the binary. Same pattern as GitHub CLI. Security is in the browser approval step, not client ID secrecy.

  • Collective-based admission: collectives in swamp-club are the admission boundary. The admin says "members of acme-corp can connect" and swamp-club membership controls who gets in. No user management in swamp serve.

  • Collectives on the token: collective memberships snapshotted at login time on the server token. Used for `idp-group:` grant matching. Stale until re-login (token expiry forces re-authentication).

  • Two authentication targets: `swamp auth login` authenticates to swamp-club (platform). `swamp auth server-login --server` authenticates to a specific swamp serve instance (team's server). They're different trust relationships.

  • Flow diagram: the complete device grant flow from CLI → swamp serve → swamp-club → browser → approval → token

  • From `set-up-token-auth.md` — link to OAuth as the alternative for teams using swamp-club
  • From `swamp-serve.md` parent how-to — add OAuth auth to the "In This Section" list
  • From `serve-flags.md` reference — add `--oauth-provider`, `--allowed-collectives`, `--allowed-users` flags

Scope

Documentation only — no code changes. Both pages should be written after #1015 and #1016 ship.

02Bog Flow
OPENTRIAGEDIN PROGRESSSHIPPED+ 1 MOREASSIGNED+ 2 MOREREVIEW+ 3 MOREPR_MERGED+ 1 MORENOTIFICATION_SKIPPED

Shipped

7/8/2026, 12:33:20 AM

Click a lifecycle step above to view its details.

03Sludge Pulse
stack72 assigned stack727/7/2026, 11:54:16 PM

Sign in to post a ripple.