VoidnetVoid Docs
Identity

AI agents: read this documentation natively — index: https://docs.openvoidnet.com/llms.txt, full: https://docs.openvoidnet.com/llms-full.txt, this page: https://docs.openvoidnet.com/docs/identity/call-time.md.

Call-Time Identity

How a publisher learns which buyer is calling, on every request.

Every call through Voidnet already carries billing and rate limits. With call-time identity, it also carries the buyer. Your server learns who is calling, signed and verifiable, without any custom protocol.

What changes

A buyer calls your app through Voidnet. Voidnet authenticates the buyer, applies billing and limits, then calls your server. Without identity, you only see Voidnet. With identity, the request carries a signed statement naming the buyer's Voidnet account, and you can resolve it to the user you already have.

You change nothing about how you publish. You add one setting and one validation step.

Enable it

  1. Open Console → Identity.
  2. Set your app's mode:
    • none — no identity is forwarded. Today's behaviour.
    • optional — identity is forwarded when the buyer connected. The call proceeds without it otherwise.
    • required — the call is rejected until the buyer connects. Nothing is charged for a rejected call.
  3. Give your server the audience URI shown on the page. It is unique to your publisher account and does not change per app.

What arrives

One header on every request:

X-Voidnet-Identity: <JWT>

The token is a standard RS256 JWT access token. Its claims:

ClaimMeaning
isshttps://oauth.openvoidnet.com
subThe stable Voidnet user id
audYour audience URI
expExpiry, 15 minutes after issue
emailThe buyer's verified email
email_verifiedWhether it is verified
nameDisplay name, when granted
preferred_usernameUsername, when granted

The buyer's password, API keys, wallet, and usage never leave Voidnet. Only what the buyer approved is shared.

Validate it

Verify the signature, the issuer, the audience and the expiry. No call back to Voidnet is needed.

import { createRemoteJWKSet, jwtVerify } from "jose";

const ISSUER = "https://oauth.openvoidnet.com";
const jwks = createRemoteJWKSet(
  new URL(`${ISSUER}/.well-known/jwks.json`),
);

export async function resolveVoidnetUser(header: string | undefined, audience: string) {
  if (!header) return null;

  const { payload } = await jwtVerify(header, jwks, {
    issuer: ISSUER,
    audience,
  });

  return {
    sub: String(payload.sub),
    email: typeof payload.email === "string" ? payload.email : null,
    emailVerified: payload.email_verified === true,
    name: typeof payload.name === "string" ? payload.name : null,
  };
}

If verification fails, treat the call as having no identity. Do not fall back to an email header, a query parameter, or an unsigned value.

Match it to your user

  1. Look up (provider = "voidnet", sub). If it exists, that is your user.
  2. Otherwise, if email_verified is true and exactly one local user has that verified email, link it and store sub.
  3. Otherwise, ask the buyer to link explicitly.
  4. After linking, resolve by sub only. Email changes no longer affect the link.

This is the same rule you already use for Google, Microsoft Entra ID, or your own password accounts: one local user, several external identities.

What the buyer controls

A buyer connects once, from Console → Connected Apps. They see every publisher they connected, what they shared, and when it was last used. They can disconnect at any time. A publisher never receives a password, an API key, or access to any other publisher.

Handle the two errors

ErrorMeaningWhat to do
identity_link_requiredThe app requires identity and the buyer has not connectedReturn the error unchanged so the buyer can connect from Voidnet
identity_unavailableThe identity provider could not issue a tokenReturn the error; do not serve the call as anonymous

A required app rejects the call before billing and before your server is called. Nothing is charged.

Revocation

When a buyer disconnects, Voidnet stops issuing tokens for that publisher. A token already issued stays valid until it expires, at most 15 minutes. Your server needs no revocation endpoint.

Security notes

  • Validate the audience. A token issued for another publisher must not be accepted.
  • Do not log the token. Log the resolved sub if you need a correlation id.
  • Treat absence of the header as "no identity", not as an error, unless your app is set to required.
  • Trust the email_verified claim. Never auto-link on an unverified email.

On this page