Passkin

Custom claims

Status: built (2026-10-05). Tests: apps/auth-broker/tests/claims-logout.test.ts.

A project can add its own claims — role, plan, an organization, a tenant — to the ID token and the access token, without code and without a "rules" engine. (Auth0's Rules and Hooks reach end-of-life on 2026-11-18; Passkin's answer is declarative templates for claims, webhooks for reacting to events, and your own backend for logic.)

Templates

curl -X PUT https://auth.passk.in/v1/manage/projects/$PROJECT/claims \
  -H "Authorization: Bearer $DASHBOARD_TOKEN" -H "Content-Type: application/json" -d '{
  "id_token":     { "role": "{{ user.public_metadata.role }}" },
  "access_token": {
    "role": "{{ user.public_metadata.role }}",
    "plan": "{{ user.public_metadata.plan }}",
    "https://shop.example.com/customer": "{{ user.external_id }}",
    "tier_label": "Plan: {{ user.public_metadata.plan.tier }}",
    "version": 2
  }
}'

A value is text, a number, true/false, or a short list or object of those. Text may hold {{ path }} placeholders. A value that is exactly one placeholder keeps its type — "{{ user.public_metadata.plan }}" is the object, "{{ user.public_metadata.seats }}" the number. Anything else is text. A placeholder with nothing behind it leaves the claim out; it is never the word "undefined".

What a template can read

Path
user.id, user.email, user.email_verified, user.first_name, user.last_name, user.username, user.phone, user.external_id the project user (external_id is the id from the system they were imported from)
user.public_metadata.<key…>, user.private_metadata.<key…> the metadata you write through the Backend API. A token is readable by the person and by the browser it passes through: putting private_metadata in one publishes it. That is a choice you make explicitly, here
session.id, session.amr this session and how the person signed in (["passkey"], ["password","otp","mfa"]…)
application.id, application.name, application.type which application the token is for
project.id

Nothing else is reachable — no other users, no environment, no prototype chain (__proto__ and constructor read as nothing), no code.

Limits and reserved names

Up to 25 claims per token; names are letters, digits and _ : . / - up to 64 characters (URLs work, as namespaced claims: https://shop.example.com/role). Passkin's own claims cannot be overridden — iss sub aud exp nbf iat jti nonce auth_time acr amr azp sid at_hash scope client_id and the profile claims (email email_verified name given_name family_name picture locale updated_at phone_number…) are refused at save, and come last when the token is built, so even a value that reached the database another way cannot replace them. Rendered claims above 4 KB add nothing (rather than a cut-off set an app might mistake for the whole); the preview says whether they fit.

Preview

POST /v1/manage/projects/:pid/claims/preview with {"user_id": "user_…"} renders the saved templates for that user, or {"user_id": …, "templates": {…}} to try unsaved ones. Answers {id_token, access_token, fits}.

When they take effect

At the next token: a refresh rebuilds both tokens from the user's current data, so a changed role appears within one access-token lifetime, or at once with a back-channel logout (INTEGRATION.md) that makes the app sign in again. Claims are not stored in the session.

Not built yet

A dashboard editor with live preview, per-application templates, organization.* (arrives with organizations), a test harness in the CLI, and conditionals. Logic beyond placeholders belongs in a webhook handler or your backend — or, later, sandboxed Actions (ROADMAP Phase 2).

Ready to try it?

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

Open the dashboard