Skip to content

Tokens and claims

Last updated 30 Nov 2026

What Accord puts in each token, and the checks your app makes before it trusts one. Every token is a JWT signed with RS256 by your environment's keys.

Three kinds of token ​

TokenComes fromTells youHow to recognise it
ID token/token, authorization codeWho signed in, for your appNo token_use claim
Access token/token, authorization codeWho signed in, with their roletoken_use is access
Machine token/token, client credentialsYour app, acting as itselfgty is client_credentials

All three last one hour (exp is iat plus 3600).

Checking a token ​

Before your app lets anybody in, check all of these:

  1. The signature, with the key from your issuer's key set whose kid the token names, and alg RS256 only.
  2. iss, byte for byte against your issuer, https://auth.nubisco.io/e/<environment id>. Never derive it from a host name.
  3. aud, against your client id. A token for another app, or from your staging environment, fails here or at the signature.
  4. exp, against the clock.
  5. nonce in an ID token, against the one you sent.
  6. That it is a person's token. Never accept a machine token as a sign-in.

With the jose library in Node.js:

ts
import { createRemoteJWKSet, jwtVerify } from "jose";

const issuer = "https://auth.nubisco.io/e/env_0123456789abcdef0123";
const jwks = createRemoteJWKSet(new URL(`${issuer}/.well-known/jwks.json`));

export async function verifyIdToken(token: string, nonce: string) {
  const { payload } = await jwtVerify(token, jwks, {
    issuer,
    audience: process.env.ACCORD_CLIENT_ID,
    algorithms: ["RS256"],
  });
  if (payload.nonce !== nonce) throw new Error("nonce mismatch");
  if (payload.token_use !== undefined) throw new Error("not an ID token");
  return payload;
}

createRemoteJWKSet caches the key set and fetches it again when a token names a kid it has not seen, which is what the key ring needs.

ID token ​

ClaimWhat
issYour issuer
subThe person's id in this environment. It does not change
audYour client id
emailThe person's email address
email_verifiedAlways true: the person proved it with an emailed code
nameThe person's name, or null when they have not given one
localeThe person's language, with the profile scope (below)
auth_timeWhen the person signed in, in seconds
nonceThe nonce you sent to /authorize, if you sent one
iat, expIssued at, and expiry

Plus the organization claims for an app whose people come from organizations.

The person's language ​

locale is the language the person chose to read, as a BCP 47 tag such as pt-PT or en. It is there only when your app asked for the profile scope, and only when the person chose a language. A person on "Automatic" has no locale claim at all, never an empty one: speak the browser's language to them, as you would without Accord.

Use it as the person's language from the moment they sign in. The tag may name a language or region your app does not have, so match it by base language (pt-BR is still Portuguese) and fall back to the browser. The value in a token is the one at sign-in. Userinfo answers the one saved now.

Access token ​

ClaimWhat
iss, subAs in the ID token
aud, azp, client_idYour client id
token_useaccess
app_idYour app's id in Accord
appYour app's slug, <workspace slug>-<app slug>
scopeThe scopes granted, separated by spaces
email, email_verified, nameAs in the ID token
localeAs in the ID token
roleThe person's role in your app. member unless changed
iat, expIssued at, and expiry

Plus the organization claims below.

Organization claims ​

For an app whose rule is Members of organizations that use it, both tokens carry:

ClaimWhat
orgsEvery organization of the person's that uses your app (see below)
org_idThe organization this sign-in is for
org_slugIts slug
org_roleThe person's role in the organization: owner, admin or member
app_roleThe person's role in your app in this organization, once your app has declared its roles

Each entry of orgs has id, slug, name, role (in the organization), ref (your app's own id for the organization, or null) and, once your app has declared its roles, app_role.

For an app open to anyone with an Accord account, the tokens carry orgs, which is empty when the person belongs to no organization that uses the app. org_id, org_slug, org_role and app_role appear when the sign-in named an organization, or when the person belongs to exactly one.

json
{
  "iss": "https://auth.nubisco.io/e/env_0123456789abcdef0123",
  "sub": "<person id>",
  "aud": "<client id>",
  "token_use": "access",
  "app": "acme-portal",
  "email": "ada@example.com",
  "email_verified": true,
  "role": "member",
  "org_id": "org_0123456789abcdef0123",
  "org_slug": "example-corp",
  "org_role": "admin",
  "app_role": "editor",
  "orgs": [
    {
      "id": "org_0123456789abcdef0123",
      "slug": "example-corp",
      "name": "Example Corp",
      "role": "admin",
      "ref": null,
      "app_role": "editor"
    }
  ],
  "iat": 1795000000,
  "exp": 1795003600
}

Machine token ​

ClaimWhat
issYour issuer
subYour client id
client_idYour client id
app_idYour app's id in Accord
audYour app's slug
token_useaccess
gtyclient_credentials
iat, expIssued at, and expiry

See Machine API and roles.

Accord is proprietary software by Nubisco.