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
- Open Console → Identity.
- Copy your audience URI. It is unique to your publisher account.
- Set each app's mode to
optionalorrequired. - Deploy the validation below.
The audience URI and the issuer do not change per app.
The contract
| Value | Where |
|---|---|
| Issuer | https://oauth.openvoidnet.com |
| Public keys | https://oauth.openvoidnet.com/.well-known/jwks.json |
| Audience | Console → Identity, https://api.openvoidnet.com/id/publisher/<your-id> |
| Header | X-Voidnet-Identity |
| Token lifetime | 15 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
| Claim | Present when |
|---|---|
iss | always |
sub | always, the stable Voidnet user id |
aud | always, your audience URI |
exp, iat | always |
scope | always |
email, email_verified | the buyer granted the email scope |
name, preferred_username | the buyer granted the profile scope |
Match it to your user
- Look up the external identity
(provider = "voidnet", sub). If it exists, that is your user. - If not, and
email_verifiedis true, find a local user with that verified email. If exactly one exists, link it and storesub. - If there is no match or the match is ambiguous, ask the buyer to link explicitly.
- After linking, resolve by
subonly. 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
| Error | Meaning | What to do |
|---|---|---|
identity_link_required | The app requires identity and the buyer has not connected. | Return the error unchanged so the buyer can connect from Voidnet. |
identity_unavailable | The 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
subif you need a correlation id. - Treat absence of the header as "no identity", not as an error, unless your app is set to
required.