Relationships
#3523 auth login leaves auth.json apiKey empty and stores the key only in ~/.config/swamp/api-key, which the auth gate never reads
Opened by keeb · 10/15/2026
Summary
After a successful swamp auth login, every command fails the auth gate with auth_gate_blocked / reason.kind: no_credential, and swamp auth whoami reports "Not authenticated". The credential exists on disk, but the CLI doesn't read it from where login wrote it.
Version
swamp 20261015.204852.0-sha.513280e9, Linux (Debian, kernel 6.12)
What's on disk after login
~/.config/swamp/:
auth.json:serverUrl,username,collectivesandapiKeyFingerprintare populated, butapiKey: ""andapiKeyId: ""api-key: the actual API key (written after auth.json; mode 600)auth_verified.json,servers.json(theserver-logintoken for a remote serve is present and valid)
Reproduce
swamp auth login(completes successfully)swamp auth whoami --json→{"error": "Not authenticated. Run 'swamp auth login' to sign in."}- Any gated command, local or
--server <remote serve>→auth_gate_blocked,no_credential
Evidence that it's the read path, not the credential
SWAMP_API_KEY="[REDACTED-SECRET-1]" swamp auth whoami→ authenticates as the right user and collectives.- Copying the contents of
api-keyintoauth.json'sapiKeyfield fixes every command, including remote-serve requests, with no env var.
Expected
Either login writes the key into auth.json as before, or the credential loader / auth gate also reads ~/.config/swamp/api-key. Login and the loader need to agree on where the key lives. whoami should also say "credential file present but key missing" rather than a bare "Not authenticated".
Impact
A freshly signed-in user, including one connecting to a remote swamp serve with a valid server-login token, gets blocked on every command right after a successful login. The error tells them to run swamp auth login, which they just did.
Open
No activity in this phase yet.
keeb commented 10/15/2026, 9:37:10 PM
This happened in a weird way :) I minted a key from my profile first, used that to do auth, then logged into a remote swamp serve. There's some combination of events there that makes this happen. I don't think it happens in a "normal" case.
Sign in to post a ripple.