Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Turso 5 min read How-to mediumAdept

The Authorization API: Platform Saga Part II

Turso's Platform API authenticates requests with JWT bearer tokens in the Authorization header, and user-owned API tokens grant access to every organization the user owns or belongs to. The walkthrough starts from the one-week temporary token issued by `turso auth token`, then covers the curl calls for querying /v1/current-user and for creating, validating, listing and revoking permanent API tokens. A token's secret is shown only once at creation and should be stored outside version control. Validation returns `exp` in epoch seconds, or -1 for tokens that never expire, and invalid tokens get a 401.

Assumes: REST APIscurlJWT basics

Related posts

  • Introducing JWT authentication in ClickHouse Cloud

    ClickHouse mediumAdept

    ClickHouse Cloud (26.4+) can authenticate clients with short-lived JWTs from any OpenID Connect provider such as Okta or Microsoft Entra, replacing database passwords. ClickHouse verifies the token signature against the provider's JWKS, then creates an in-memory ephemeral user named JWT::<subject>::<claims_hash> carrying the roles from the token, and removes it after expiry, so no CREATE/DROP USER provisioning is needed. Quotas, settings profiles and row policies attach to a stable UUID derived from issuer, subject and audience, and definer views get a persistent non-login shadow user so they survive token expiry. Client libraries for JS, Python, Go and Java accept bearer tokens with refresh hooks, and custom providers require the Enterprise plan.

  • Giving Agents Their Own Turso Accounts with AgentID

    Turso mediumAdept

    AgentID is an OpenID Connect provider for AI agents: instead of a human completing a browser login, the agent approves an OIDC Authorization Code + PKCE request by signing a compact ES256 JWS (request ID plus inbox ID) with a P-256 key it holds, registered via AgentMail. Turso, as a relying party, receives a stable agent `sub` and verified AgentMail inbox email in the ID token, with the human owner's name and email served separately from the userinfo endpoint. This keeps agent, owner and application identities distinct. The inbox doubles as a live channel for account notifications. Live checks on credential revocation, inbox deletion, org suspension and transaction expiry gate every sign-in, and JWKS can be cached by kid thanks to overlapping key rotation.

  • How we built Render OIDC

    Render mediumAdept

    Render issues per-service OIDC tokens so workloads can authenticate to AWS, GCP, OpenAI and Anthropic without long-lived API keys. Tokens expire after 60 minutes as a tradeoff between leak exposure and tolerance for issuer outages. Per-workspace issuer URLs protect against providers misconfigured to skip subject checks, and per-provider audience claims block token replay across providers. Because SDKs mostly expect a token file, an external OIDC Daemon writes and refreshes tokens into a read-only bind mount backed by /dev/shm, and Render sets provider-specific env vars such as AWS_WEB_IDENTITY_TOKEN_FILE.

  • WTF Are JWTs?

    Neon mediumAdept

    JSON Web Tokens are compact, signed, self-contained tokens made of three base64url segments (header, payload of registered and custom claims, and an HMAC or RSA signature). They replaced database-backed sessions for stateless, cross-service auth. A worked Node.js example builds an HS256 token by hand, and JWKS endpoints let services fetch an auth provider's public keys by kid to verify tokens and support key rotation. In Neon RLS, verified claims such as tenant_id drive Postgres row-level security policies. JWTs are signed but not encrypted, so sensitive data should stay out of the payload or use encrypted JWTs.

  • Scope your Personal Access Tokens

    Supabase mediumAdept

    Supabase Personal Access Tokens can now be scoped to specific organizations or projects, granular permissions, and an expiry of up to one year, and Dashboard-created tokens are scoped by default. A token's effective access is always bounded by the creating user's current role, so revoked user permissions immediately limit the token. Scoped tokens use the sbp_fc prefix and work with the Management API (403s list missing_permissions), the MCP server (per-tool permission checks), and the CLI via --token or SUPABASE_ACCESS_TOKEN, with caveats: SUPABASE_DB_PASSWORD bypasses token permissions and supabase link needs extra read scopes. Existing full-access tokens are labeled Legacy and keep working with no deprecation date.

The quest for software engineering knowledge.

Look:
Layout: