Skip to main content

Verified Identity Claims in JWTs Without Storing ID Documents

Didit puts the claims you select into the JWT's verified object, never the ID document. Full ID $0.33, liveness $0.10; approved claims reach a refreshed token within 5 minutes.

Verified Identity Claims in JWTs Without Storing ID Documents

Contents

In this guide

Jump to the part you need.

You want an age claim and a verified name inside an access token, without storing anyone's passport scan. With Didit Authentication, we run the check as a verification session and put the claims you select in the token's verified object. It fits an age gate or a verified-name check at sign-up. List price is $0.33 for a full ID check and $0.10 for liveness. The caveat: anything holding the token can read those claims, so select only what the app needs.

Last updated: November 26, 2026. Prices checked against the live Didit price feed on November 26, 2026.

Verified claims you can carry in a Didit token
ClaimWhat it saysFormat
over_18The person is 18 or olderboolean
over_21The person is 21 or olderboolean
given_nameFirst name from the verified documentstring
family_nameLast name from the verified documentstring
birthdateDate of birthYYYY-MM-DD
nationalityNationalitystring
countryCountryISO 3166-1 alpha-2
document_verifiedThe identity document passed verificationboolean
livenessA live person was presentboolean

Start free in the sandbox at business.didit.me, with no sales call. For developers who want an AI assistant to help write the integration, connect Didit through the Didit MCP setup guide. Every price below is published on the Didit pricing page, and the flow is described in the Didit Authentication overview in the docs.

What the finished flow does

At the moment you choose, before an account exists or before a payout, the person goes through one verification session. Didit creates that session with the person's vendor_data, so it lands on the same person as their sign-ins and transactions, appears in your verifications, goes to manual review like any other verification, and is billed at that check's price.

In this Authentication flow, your app receives the selected claims and verification level. Authentication does not send your app the ID document, selfie or face data. When the check is approved, the claims you selected appear in the person's tokens at the next refresh, within 5 minutes.

On the hosted pages, Didit sends the person through the check during sign-up. On your own screens, the sign-up call answers verification_required with a verification_url that works for 30 minutes, and Didit issues the sign-in code only after the check is approved.

Gate the action in one line: grant access only when the validated access token carries over_18 equal to true, and treat a missing claim as unverified.

A selfie being captured during the liveness step
The liveness level asks for one selfie. The selected liveness claim can appear in the token.

Verification checks, and the claims each one can produce

Verification checks, what the person does, and list price per check
CheckWhat the person doesList price
livenessOne selfie, checked for liveness$0.10
liveness_face_matchA selfie matched to the face Didit already holds for the person, the selfie login check$0.10
full_idScans an identity document and takes a selfie: document, liveness and face match$0.33

The sign-up levels are none, liveness and full_id. A step-up rule can ask for the selfie login check instead, and when Didit holds no face for the person yet, a selfie login becomes a full ID check.

Each check establishes something different. Liveness checks that a live person is present. Selfie login also matches the face Didit already holds for the person. An age gate needs a verified age claim, so it needs over_18 from a check that produced it.

Claims that come from a document, such as given_name, family_name, birthdate and nationality, exist only when a document was read, so plan on full_id whenever the name itself has to be verified rather than asserted.

Everything that holds the token can read its claims. Browser or mobile code can read any token it holds, and anyone with access to a logged copy can read it too. Put only what the app needs in the claims array.

The ID document tab of a verification session in the Didit Business Console
The ID document tab in the Didit Business Console. In this Authentication flow, your app receives claims, not this document.

Prerequisites

  • A Didit account with a sandbox application. Sandbox applications have Authentication turned on already; a live application turns it on from the Products page.
  • A redirect URL you register character by character, plus the allowed origin for your web app.
  • The application's publishable key. It is public and it starts with pk_test_ or pk_live_.
  • Node.js 20 or later if you use @didit-protocol/auth, or any JWT library that verifies ES256 against a JWKS.
  • For the PATCH example, use the application's full-access API key or a key with authentication write access. An owner-approved management grant with didit:management and an authorized console session also work on the same setup routes.
  • A backend you control. The decision that matters is made from a verified token, not from what the browser displays.

Add over_18 and a verified name to the access token, step by step

  1. Pick the level and the claims. Open Authentication > Verified identity in the Business Console and choose the level a person must pass before their account exists. none lets anyone sign up, liveness requires one selfie checked for liveness, and full_id requires a document, liveness and a face match. A new level applies to people who sign up from then on, never to existing accounts. Then select the claims array. By API, the same field is on the application's Authentication management API, whose base is https://apx.didit.me/auth/v2/organizations/{org_id}/applications/{application_id}/authentication/.

    curl --fail-with-body --request PATCH "${MANAGEMENT_BASE}verified/" \
      -H "x-api-key: $DIDIT_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{"claims": ["over_18", "given_name", "family_name"]}'

    Use one claim for an age gate: ["over_18"]. Add given_name, family_name or nationality only when the application actually uses those fields.

  2. Register the callback and the origin. In Authentication > Security and sessions > Redirect URLs and allowed origins, add http://localhost:3000/auth/callback as a redirect URL and http://localhost:3000 as an allowed origin. Didit only returns a person to a redirect URL you registered, character by character.

  3. Turn on a sign-in method and copy the publishable key. Open Authentication > Sign-in methods and turn on email code, and passkeys if you want them. A new application starts with every method off. Copy the publishable key from Authentication > Developers. Never put the secret key in browser or mobile code.

  4. Send the person through sign-in. The SDK builds the authorization request, keeps the PKCE verifier, and handles the callback exchange. Keep the sign-in button and the callback as two separate entry points.

    import { createDiditAuth } from "@didit-protocol/auth";
    
    export const auth = createDiditAuth({
      publishableKey: "pk_test_...",
      redirectUri: "http://localhost:3000/auth/callback",
    });
    
    // Your sign-in button
    export async function onSignInClick() {
      await auth.signIn({ returnTo: "/dashboard" });
    }
    
    // Run once on http://localhost:3000/auth/callback
    export async function onCallbackPage() {
      const { session, returnTo } = await auth.handleRedirectCallback();
      console.log(session.email, session.vendorData);
      window.location.replace(returnTo ?? "/");
    }
  5. Optional: exchange the code yourself, for integrations without the SDK. Here you own the whole contract. Check the callback state first, then exchange the code within 60 seconds because each code works once. The verifier and redirect_uri must match the request that started the sign-in, so use the redirect URL you registered.

    curl --fail-with-body "${DIDIT_AUTH_ISSUER}/token/" \
      -H 'Content-Type: application/json' \
      -d '{
        "grant_type": "authorization_code",
        "code": "CODE_FROM_CALLBACK",
        "code_verifier": "YOUR_PKCE_VERIFIER",
        "redirect_uri": "http://localhost:3000/auth/callback"
      }'
  6. This snippet verifies the signature, issuer and expiry. Before using the returned claims to authorize a request, verify that the protected JWT header has typ set to at+jwt, that the payload’s aud matches your application ID, and that act is null unless the route accepts AI agents.

    import { verifyToken } from "@didit-protocol/auth/server";
    
    const claims = await verifyToken(token, { publishableKey: process.env.DIDIT_PUBLISHABLE_KEY });
    
    // Before authorizing the request:
    // 1. Read typ from the protected JWT header and require "at+jwt".
    // 2. Require claims.aud === process.env.DIDIT_APPLICATION_ID.
    // 3. Require claims.act === null unless the route accepts AI agents.
  7. Check the live session before a sensitive action. An access token stays valid until it expires, within 5 minutes, so claims are a snapshot. Call GET {issuer}/session/ before a payout, and it fails at once when the session was revoked, went idle or expired, when the person was blocked, or when the session no longer meets your MFA policy. The same call returns null for the claims when the person passed no check.

  8. Ask for a step-up when the action is risky. Before each payout, bank account addition or change, or email or phone change, call the step-up endpoint so Didit can evaluate the configured rules. For payouts, those rules can also consider a new device or a different currency. A 200 with {"required": false} means no rule applies, so the action proceeds. A 201 returns a verification_url: send the person there.

    curl --fail-with-body "${DIDIT_AUTH_ISSUER}/step-up/" \
      -H "Authorization: Bearer $ACCESS_TOKEN" \
      -H "Content-Type: application/json" \
      -d '{"action": "payout", "amount": "900.00", "currency": "USD", "return_to": "https://app.example.com/payouts/confirm"}'
  9. Confirm the step-up on your backend. The person comes back to return_to with step_up=<id>&status=approved added, and that appended status proves nothing. Call GET {issuer}/step-up/{step_up_id}/ with an access token from the same session and proceed only when your backend reads approved. A step-up never fails open: when verification is unavailable, the action stays blocked.

Expected output

After a full_id check is approved and the token is refreshed, the access token payload carries the claims you selected, plus the level:

{
  "iss": "https://acme.sandbox.auth.didit.me",
  "aud": "YOUR_APPLICATION_ID",
  "sub": "c9abf6cc-2d64-4bf2-b31e-a4d09a070ab1",
  "verified": {
    "level": "full_id",
    "over_18": true,
    "given_name": "Marta",
    "family_name": "Ruiz"
  }
}

verified also carries level after a passed check, and the liveness boolean appears only when you selected it in the claims array. A person who passed no check carries an empty object, and the session endpoint answers null for the claims:

{ "verified": {} }

When the application needs nationality as well, add it to the array and the claim appears on the next refreshed token:

curl --fail-with-body --request PATCH "${MANAGEMENT_BASE}verified/" \
  -H "x-api-key: $DIDIT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"claims": ["over_18", "given_name", "family_name", "nationality"]}'

Test both states in the sandbox. In the first case, drive one full ID check to approval and inspect the refreshed token for the selected claims and level. In the second, sign in an account that has passed no check, then inspect the token for verified as {} and the session response for null claims.

Keys rotate every 30 days and each token names its key in the kid header. Cache the JWKS by kid, and when a token names a key you do not have, fetch the JWKS again at most once a minute and reject the token if the key is still missing. The tokens and JWKS page documents the full verification contract.

Inputs and outputs

What you configure, and what the token then carries
InputWhere you set itOutput in the token
Sign-up level noneAuthentication > Verified identityverified is {} if the person has passed no verification check
Sign-up level livenessAuthentication > Verified identity{"level": "liveness", "liveness": true} when liveness was selected
Sign-up level full_idAuthentication > Verified identity{"level": "full_id", ...} with the document claims you selected
claims arrayConsole, or PATCH verified/The claims in the array, plus level after a passed check
Step-up rule set to full IDStep-up rulesNew claims on new tokens after the step-up is approved

The liveness boolean in these rows assumes liveness was selected in the claims array.

Failure cases and how to recover

Symptoms, causes and recovery
SymptomLikely causeRecovery
verified is {} and the session endpoint returns nullThe person has passed no verification checkFor an existing account, send the person through a configured step-up. A higher sign-up requirement applies only to future sign-ups.
A claim you selected is missingThe check that ran cannot produce it, for example a name without a documentMove the person to full_id
Newly approved claims are missing from the current tokenThe access token was issued before the approvalObtain a refreshed token before applying the gate
400 invalid_grant on the exchangeCode used, expired, or the verifier or redirect URL does not match, or the person is blockedRestart sign-in with a fresh PKCE verifier and check the callback state
GET /session/ answers 401 for tokens that used to workYou activated a custom domain and the issuer changedRefresh the access token after activating the custom domain and update your backend's issuer configuration. Dual-issuer acceptance covers local JWT validation only; it does not make old-issuer tokens work with GET /session/.
Signature check fails after a rotationA cached JWKS without the new kidRefetch the JWKS, at most once a minute
Step-up returns pending or expiredThe person has not finished, or the 30 minutes passedSend them back to the verification URL while it works, or create a new step-up
Step-up returns declinedThe person did not passIt is not final while verification_url still works: they can try again

Each check is a verification session, and the published list prices are per completed check: $0.10 for liveness, $0.10 for selfie login, $0.33 for a full ID check. The first 50,000 active users each month are free on Authentication, and each active user after that is published at $0.02 per active user month. The sandbox is free and never billed.

A check that goes to manual review is not approved yet, so the pending check contributes no new claims until a reviewer approves it. Nothing about verified identity bypasses your review rules: it is the same session, the same review queue and the same billing as any other verification of that application.

The liveness tab of a verification session in the Didit Business Console
A check under review holds its new claims back until a reviewer approves it.

Worked cost example

Take one application in a month with 10,000 completed full ID checks at sign-up and 500 completed selfie logins, all for people whose faces Didit already holds.

  • 10,000 x $0.33 = $3,300.00 for full ID checks.
  • 500 x $0.10 = $50.00 for selfie logins.
  • Total list-price verification usage: $3,300.00 + $50.00 = $3,350.00.
  • Per person: $3,350.00 / 10,000 = $0.335.
  • Active users: at 10,000 total monthly active users, the account stays below the 50,000 monthly free allowance, so the Authentication active-user charge is $0.00.

Growth applies 4% off Didit prices and Scale applies 10%, which would put the same verification usage at $3,216.00 and $3,015.00. Those two figures are verification usage only, before the plan fee and the monthly credit. Run your own numbers on the cost estimator.

Sources

Open a sandbox application at business.didit.me and turn on verified identity. Select over_18 and a verified name, complete a full ID check in the sandbox, then verify the access token on your backend and read the selected claims. If the token was issued before approval, refresh it first. No sales call, and the sandbox is never billed.

Try it

Try this in the sandbox

Run the check this guide describes, free.

ID Verification

The product this post is about, taken from its topic. Run it free in the sandbox.

$0.15 per checkStart free

Author

Alberto Rosas

Co-founder and CEO

Alberto Rosas

Alberto Rosas

Co-founder and CEO

About Didit

Questions

Frequently asked questions

Can I add over_18 and a verified name to a JWT without storing ID documents?

Yes. In this Authentication flow, your app receives the selected claims and verification level, and Authentication does not send your app the ID document, selfie or face data. You do not have to store a document to use the claims.

Which claims can Didit put in the access token?

The selectable set is over_18, over_21, given_name, family_name, birthdate as YYYY-MM-DD, nationality, country as an ISO 3166-1 alpha-2 code, document_verified and liveness. They sit in verified together with a level of liveness, liveness_face_match or full_id. You choose the subset in the console or with the claims array on PATCH verified/.

What does the verified claim look like when no check passed?

The token carries verified as an empty object, {}, and GET /session/ returns null for the claims. Treat both as a real answer, not as an error. Your backend should refuse the gated action rather than assume a default.

How long until an approved check shows up in the token?

Approved checks reach the tokens at the next refresh, within 5 minutes. A token issued before the approval never changes after the fact. Wait for a refreshed token before acting on newly approved token claims, and if the action requires a step-up, confirm its approval through the authenticated step-up status endpoint.

Can the front end read the verified claims?

Yes. The access token is a signed JWT, so any code holding it, including your front end, can decode its claims. That is fine for showing a verified badge, and it is not a reason to put more in the token than the screen needs. Keep raw tokens out of logs, and make the decisions that matter on your backend from a verified token.

What is the difference between liveness, liveness_face_match and full_id?

liveness is one selfie checked for liveness at $0.10, and it establishes that a live person is present. liveness_face_match is the selfie login check at $0.10, and it also matches the face Didit already holds for the person. full_id is a document scan, liveness and a face match at $0.33, and it is the level that produces claims such as a verified name or a nationality. For a document-backed age gate, select over_18 and require full_id. Grant access only when the verified access token contains verified.over_18 set to true.

Do I have to verify the token signature myself?

Your backend must verify the access token on every protected request. You can use the documented verifyToken helper from @didit-protocol/auth/server. Enforce the rest explicitly: check the ES256 signature against your application issuer's JWKS and enforce iss, aud, exp and typ set to at+jwt, and reject a non-null act on routes that do not accept AI agents. Live and sandbox applications are separate issuers with separate keys.

How do I change which claims go into the token?

Change the claims array, in the console or with PATCH verified/. The change applies to tokens issued afterwards, so a person may keep an older, smaller set until their next refresh. Selecting fewer claims is the right default, because anyone who holds the token can read everything in it.

What does this cost per person?

The check is the paid step: $0.10 for liveness, $0.10 for selfie login, $0.33 for a full ID check at list price. The first 50,000 active users each month are free on Authentication and $0.02 per active user month after that, and the sandbox is never billed. Growth and Scale apply 4% and 10% off Didit prices.

What happens if the check goes to manual review?

A pending check contributes no new claims until it is approved. When a reviewer approves it, expect the updated claims at the person's next token refresh. The session sits in the same review queue as any other verification of your application.

Compliance built in

Audited, certified and attested.

We hold the certifications and build each country's rules into your flows, so you can launch anywhere without worrying. Security and Compliance center

  • Regulation encoded into your flows

    Tell us what you do and where. Didit lists the rules that apply to you, with sources, and builds the checks each country needs into one workflow.

  • Ready for AMLR

    Every requirement of the new EU anti-money laundering rules, from checking customers to human review, is already covered by a Didit check.

  • Tested in Spain's Treasury sandbox

    Spain's Treasury published its supervised sandbox report on Didit's NFC plus active liveness onboarding; SEPBLAC took part and valued the added measures positively.

  • Audited, not self-declared

    iBeta Level 1 and Level 2. Liveness tested under ISO/IEC 30107-3.

Compliance assistant

Your obligations · 3 regions

EU · AMLRCustomer due diligence, human reviewCovered
Illinois, Texas, ColoradoExplicit biometric consentCovered
Germany · Youth protectionVerified adults only (JMStV)Covered
Workflow checked. Every obligation is met
  • SOC 2 Type 2
  • ISO 27001
  • iBeta Level 1 and Level 2
  • EU regulator attestation
  • FSM youth protection
  • GDPR
  • EBA remote onboarding
  • MiCA compatible
  • FIDO Alliance member
  • AMLREU AML Regulation ready

Integration · Didit MCP

Run Didit from your own AI agent

Connect Didit to Claude, Cursor, VS Code or ChatGPT and just ask in plain words. Your agent can do anything you can do in the console, with the same permissions you have.

Add to ClaudeChatGPT
Didit Academy · Lesson 04 · Use Didit with MCP
  • Build workflowsDescribe the checks you need. The agent creates and publishes the flow.
  • Run investigationsAsk why a session was declined, review cases, search people and companies.
  • Change rulesCreate payment rules, test them on past data and switch them on.
  • Pull reportsAsk for numbers, exports or the audit log.

Verify your first user today.

Start free

Free sandbox. Credit applies to work-email sign-ups.