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/publisher.md.

Identity for Publishers

Validate the Voidnet identity token and resolve it to your own user.

When an app receives a call from Voidnet, the request can carry the buyer's Voidnet identity in the X-Voidnet-Identity header. The value is a signed JWT. Validating it needs no Voidnet SDK and no call back to Voidnet.

To let people sign in to your own website with their Voidnet account, see Sign in with Voidnet.

Enable it

  1. Open Console → Identity.
  2. Copy your audience URI. It is unique to your publisher account.
  3. Set each app's mode to optional or required.
  4. Deploy the validation below.

The audience URI and the issuer do not change per app.

The contract

ValueWhere
Issuerhttps://oauth.openvoidnet.com
Public keyshttps://oauth.openvoidnet.com/.well-known/jwks.json
AudienceConsole → Identity, https://api.openvoidnet.com/id/publisher/<your-id>
HeaderX-Voidnet-Identity
Token lifetime15 minutes

Validate

The token is an RS256 JWT access token. Verify the signature, the issuer, the audience and the expiry. Never trust an unverified claim.

import { createRemoteJWKSet, jwtVerify } from "jose";

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

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

  const { payload } = await jwtVerify(header, jwks, {
    issuer: "https://oauth.openvoidnet.com",
    audience: "https://api.openvoidnet.com/id/publisher/YOUR_PUBLISHER_ID",
  });

  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,
    username: typeof payload.preferred_username === "string" ? payload.preferred_username : null,
  };
}

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

Claims

ClaimPresent when
issalways
subalways, the stable Voidnet user id
audalways, your audience URI
exp, iatalways
scopealways
email, email_verifiedthe buyer granted the email scope
name, preferred_usernamethe buyer granted the profile scope

Match it to your user

  1. Look up the external identity (provider = "voidnet", sub). If it exists, that is your user.
  2. If not, and email_verified is true, find a local user with that verified email. If exactly one exists, link it and store sub.
  3. If there is no match or the match is ambiguous, ask the buyer to link explicitly.
  4. After linking, resolve by sub only. Email changes no longer affect the link.

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

Handle the two errors

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

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.

On this page