Skip to content

Authentication

A browser authenticates with its session cookie. Everything else presents a token:

Terminal window
curl -H "Authorization: Bearer $TOKEN" https://you.mudda.today/boards.json

The scheme is matched case-sensitively: Bearer and Token are accepted, bearer is not. An Authorization header always decides the request: send one and the cookie is ignored, so a rejected token is a 401, never a quiet fallback to a browser session on the same machine. A browser’s session is never accepted as a bearer token, and neither a bearer request nor a JSON sign-in is ever handed a cookie.

  • The browser: profile (your avatar) → API tokens. The token is shown once.
  • Signing in over JSON, below.
  • OAuth, which is how MCP clients connect. It produces a token that behaves like the others; see OAuth.
  • A shell, on a self-hosted board: make token LABEL=claude (see Managing tokens).

A minted token is valid for 90 days. An expired token is refused exactly like a revoked one, with a 401 and nothing to tell the two apart, so treat a sudden 401 on a long-lived agent as “mint a new token”. A browser session never expires on a timer.

Terminal window
curl -X POST https://you.mudda.today/session/password.json \
-H 'Content-Type: application/json' \
-d '{"email_address":"you@example.com","password":"…","label":"claude"}'
# => {"session_token":"…","scopes":["read","write"]}
  • label names the token. Without one it is json-sign-in. Give every client its own label: a label holds one live token, so two clients sharing the default would revoke each other on every sign-in.
  • scopes (a string or a list) chooses what the token may do; without it the token reads and writes. An unknown scope is a 422.

The credentials may also be wrapped: {"session":{"email_address":"…","password":"…"}}. Sign-in is rate limited to 10 attempts every 3 minutes per IP address.

POST /session/passkey.json completes a passkey sign-in and answers {"session_token":"…"}. It always mints a json-sign-in token with the default scopes.

A token does what its scopes grant, and the request’s verb decides which scope it needs:

Scope Allows
read GET
write POST, PUT, PATCH: creating and changing
delete DELETE, or a write that removes nested records ("_destroy": true)

A token gets read write unless asked otherwise, so delete is only ever granted on request: tick it on the API tokens page, or send it in scopes at sign-in. A request outside a token’s scopes is a 403 before the action runs, so nothing is written:

{ "errors": { "base": ["This token is not granted the write scope"] }, "request_id": "…" }

Two requests are open to every token, whatever its scopes: DELETE /session.json, which ends the token’s own session, and GET /my/user.json, which reports the token making the request. Browser sessions are never limited by scope.

A label holds one live token. Minting under a label revokes the token that label already had, so an agent that signs in on every run replaces its credential instead of piling them up. Labels exist so one agent’s access can be revoked without signing your browser out.

What a token does is attributed to it. Every token acts as the account’s one user, so you are still the creator of what it makes, but the audit trail records the token’s label. Name tokens after the agent holding them.

The API tokens page lists every token, OAuth clients included, with its scopes and expiry, mints new ones, and revokes them. Only a signed-in browser can use it, so a token can’t manage tokens or passkeys. DELETE /session.json ends the token making the request.

On a self-hosted board the same is available from a shell, each target wrapping a bin/rails auth:* task in the app’s container:

Command What it does
make token LABEL=claude Mint a token and print it. Unlabelled, it is api. SCOPES="read write delete" grants more
make tokens List tokens (OAuth clients included) with their scopes, when they were minted, and when they expire
make revoke LABEL=claude Revoke the tokens carrying that label
make reset-auth Revoke every token, browser session, and OAuth grant, and remove every passkey

A deactivated user’s token is refused with a 403 but not revoked; it works again once the user is reactivated.