Passkin

The token vault: your users' other accounts, for your server and your agents

Status: built (2026-10-05). Tests: apps/auth-broker/tests/vault.test.ts, packages/react/tests/components.test.tsx (ConnectedAccounts), packages/cli/tests/cli.test.ts.

Your product — or an AI agent working for one of your users — often needs to reach something of the user's at another service: their Google calendar, their GitHub repositories, their Slack channels. Getting that means running OAuth against each provider, storing refresh tokens somewhere safe, refreshing them without losing one to a race, noticing when the user revokes, and never letting a token leak. The vault does all of that. A person connects an account to your project; your server asks Passkin for a fresh token whenever it needs one. (Auth0 calls this Token Vault; WorkOS, Pipes.)

 your user            your app / agent          Passkin                      the provider (Google…)
    │  "Connect Google"      │                     │                                │
    │───────────────────────▶│ POST /v1/me/connections {provider, scopes}          │
    │                        │────────────────────▶│ (only scopes you allowed)      │
    │◀── redirect to Google ─┴─────────────────────│                                │
    │  signs in, agrees ─────────────────────────────────────────────────────────▶ │
    │◀── back to Passkin /callback/connect ─────────┤ exchanges the code, stores the tokens, encrypted
    │◀── back to your app: ?connection=google&status=connected                      │
    │                        │ POST /v1/users/:id/connections/google/token  (secret key)
    │                        │────────────────────▶│ refreshes if it must           │
    │                        │◀─ { access_token, expires_at, scopes } ───────────────│

Off until you switch it on (dashboard → Connections, or PATCH …/projects/:pid/connections/settings).

Set up

  1. Register Passkin's callback address as a redirect URL in the provider's OAuth app: https://auth.passk.in/callback/connect (the dashboard shows the exact address for your deployment).
  2. Use your own OAuth app. A built-in provider — Google, GitHub, Microsoft, LinkedIn, Discord — is used only with the credentials you brought (Sign-in methods → bring your own). Passkin's shared app is registered for sign-in with identity scopes; spending its reputation on a person's calendar or repositories is not something it will do for you, and Google reviews sensitive scopes per app. Without your own app the provider simply shows as needs your own app.
  3. List the scopes your product may ask for, per provider. Nothing else can be requested — not by your front end, not by a script injected into it, not by an agent. With none listed a provider cannot be connected.
  4. Or add a provider of your own — anything OAuth 2.0: Slack, Notion, Linear, Atlassian, HubSpot… — with its authorize and token addresses, your app's client id and secret (stored encrypted, never shown again), how it wants the client to authenticate (body or HTTP Basic), the scope separator, PKCE, and the scopes you allow. Optionally a userinfo address (so Passkin knows which account it is and the same one connected twice is one connection) and a revoke address. The token, userinfo and revoke addresses must be public https hosts: Passkin calls them from its server.

Connecting (the person's side)

From your front end, with the person's access token:

const { authorize_url } = await fetch("https://auth.passk.in/v1/me/connections", {
  method: "POST", headers: { Authorization: `Bearer ${accessToken}`, "Content-Type": "application/json" },
  body: JSON.stringify({ provider: "google", scopes: ["https://www.googleapis.com/auth/calendar.readonly"], redirect_uri: "https://app.example.com/settings", state: "anything" })
}).then((r) => r.json());
location.assign(authorize_url);
// …back at redirect_uri: ?connection=google&status=connected&state=anything   (or &status=error&error=access_denied|limit|provider_unavailable|…)

Or drop in the component: <ConnectedAccounts /> from @passkin/react lists what is connected (provider, which account, what it may do), offers a button for each provider you allow, asks before disconnecting, offers Connect again when a connection broke — in English, Arabic, Spanish and French (ACCOUNT.md). From your server you can also start one for a person: POST /v1/users/:id/connections (secret key) with the same body.

  • redirect_uri must be one of the application's registered redirect URLs. Omit it and the person sees a page ("Account connected") instead.
  • The person's own browser completes it. The provider sends the browser back to Passkin, which requires the Passkin session in that browser to be the same person the connection was started for; otherwise nothing is connected and the browser is told the link was made for someone else. Without that, anyone could start a connection for themselves and send the link to a victim — and the victim's Google account would end up attached to the attacker's user. The link is one use and lasts ten minutes. (A person who has never signed in — an imported, unclaimed user — has no Passkin account to complete it with.)
  • The same provider account connected again is the same connection, with the newest tokens; Google's habit of sending a refresh token only the first time is handled (the old one stands). A person can hold up to ten.
  • GET /v1/me/connections lists theirs (provider, account.label, scopes, status) with the providers on offer; DELETE /v1/me/connections/:id disconnects. No token is in any of it.

Getting a token (your server's side)

curl -X POST https://auth.passk.in/v1/users/user_…/connections/google/token \
  -H "Authorization: Bearer $PASSKIN_SECRET_KEY" -H "Content-Type: application/json" \
  -d '{"scopes":["https://www.googleapis.com/auth/calendar.readonly"]}'
# → { "access_token": "ya29…", "token_type": "Bearer", "expires_at": "2026-10-05T13:00:00Z", "scopes": ["…"], "connection": { "id": "cacct_…", … } }
  • scopes (optional) says what you are about to do: if the connection was not granted every one, you get 403 insufficient_scope with missing — send the person through a new connection with them (Google adds to what was granted before). account picks one when a person has several at the provider; otherwise the most recent active one.
  • A token that expires within a minute is refreshed first, once per account even if many requests arrive together (providers that rotate refresh tokens would otherwise lose one to the race). A provider that is down gives 502 provider_unavailable and the connection is kept; a provider that says the grant is gone (revoked, expired, password changed) marks the account needs_reauth, the call answers 409 reauthorization_required, and connection.needs_reauth is audited and sent as a webhook — the person connects again and it is back.
  • Rate limit: 300 a minute per user. Every token issued is in the audit log (connection.token_issued: which user, which provider, which scopes — never the token).

For an agent

An agent's access to a user's other accounts is your server's decision, made with Passkin's help: the agent (an MCP client, a script) authenticates to your API or MCP server with an OAuth token (OAUTH.md); your server verifies it, learns who the person is (sub) and what the agent may do (scope), and — only if that covers it — asks the vault for the user's token and makes the call itself. The agent never holds the provider token, and taking its grant back (or disconnecting the account) stops it at once.

What is guaranteed

  • A token leaves only to your secret key, one at a time. No list, export, database sync, webhook payload, audit entry, log line or end-user endpoint ever carries one: a script that steals a person's session can disconnect an account but cannot read a token. Tokens are encrypted with Passkin's master key at rest.
  • The scopes are yours: a request for anything you did not list is refused before the provider is contacted.
  • The browser must be the person's. See above.
  • Disconnecting works: the person or you can do it; the provider is asked to revoke (Google, Discord, LinkedIn, GitHub's grant, or your provider's revoke address) and the tokens are deleted whether or not the provider answered. Deleting the user, or the provider's definition, deletes the connections it held.
  • A banned person's tokens are not issued; switching the vault off stops issuing at once.

Management API

GET …/projects/:pid/connections (state, providers, the callback address, how many accounts) · PATCH …/connections/settings (enabled, scopes: { google: [...] }) · POST|PATCH|DELETE …/connections/providers[/:key] · GET|DELETE …/users/:uid/connections[/:cid]. Audited as connection.*; connection.connected, connection.disconnected and connection.needs_reauth are webhook events. In passkin.config.json (PLATFORM-API.md): "connections": { "enabled": true, "scopes": { "google": ["…"] } } (providers of your own carry a secret, so they are made in the dashboard).

Not built

A provider catalogue beyond the five built in and the generic one (Passkin does not ship a registry of Slack, Notion, … presets yet); incremental authorization UX beyond Google's; a userinfo for providers that give none (their accounts are one-per-person per provider); DPoP-bound or mTLS provider tokens; Google's own verification of your app for restricted scopes (yours to obtain, as with any app); delivering a token to an agent directly, without your server (deliberately: see For an agent); connected-account rows on the dashboard's user page (the API has them).

Ready to try it?

Create a project — the dashboard fills these snippets in with your own keys.

Open the dashboard