- Authenticating a User
- Performing credentials-related operations such as issuing or verifying credentials
scope: "issue" and typ: "JWT". The JWT no longer carries an email claim — the credential recipient is identified when you call initialize-user (the email is passed in the request body), not through a JWT claim. See Issuing Credentials for concepts and Issuance API Reference for endpoint usage.
JWT Details
- Signing algorithms supported: ES256, RS256
- Expiry: 5 min (recommended)
- Claims: varies depending on the operation. You would always need to include your
partnerIdas one of the claims - Header: You must include a
kid(Key ID) header to indicate which key was used to sign the JWT. AIR Kit useskidto select the matching key from your JWKS endpoint. - JWKS URL: AIR Kit validates your JWT using JWK standards (RFC 7517). You must publish your public key at a JWKS URL and register it in the dashboard. See JWKS endpoint setup for the full procedure.
JWKS endpoint (required for all credential SDK operations)
issueCredential, verifyCredential, and on-demand issuance all rely on the same Partner JWT trust model — AIR Kit fetches your registered JWKS URL and validates every JWT against it. The endpoint must be:
- A public HTTPS URL reachable from AIR servers (localhost is not enough).
- Registered in Dashboard → Account → General Settings → JWKS URL as the full URL your app actually serves.
- Returning a JSON document whose
keys[].kidmatches thekidyou set in your JWT header.
app/api/.well-known/jwks/route.ts, used by every issuer and verifier in air-examples. For implementation, dashboard registration, local HTTPS tunnels, and the kid rule, see the JWKS endpoint setup page.
Issuance JWT
For AIR KitissueCredential and
On-demand issuance, use a Partner JWT with
these fields. For on-demand issuance, the recipient is resolved through the
initialize-user call, so no email claim is required in the JWT.
JWKS reminders for issuance:
kidin JWT header must match a key ID exposed by your JWKS endpoint- JWKS endpoint must be publicly reachable by AIR Kit
Next.js Partner JWT endpoint
Installjose:
app/api/partner-jwt/route.ts
PARTNER_PRIVATE_KEY server-only. The JWT kid must match a key in the
JWKS registered for the Partner ID.
Generating Partner JWTs
Generating an RS256 Key Pair
To generate a private/public key pair, you may use OpenSSL:private.key: Use this file as your signing key in backend code.public.key: Use this to configure your JWKS endpoint for JWT verification.
Tip: Keep your private key secure and never share it publicly.
Examples
Below are backend code examples for generating a JWT using ES256 or RS256 algorithms, including thekid (Key ID) header.
- Node.js
- Java
- C#
- Go