Scopes & Claims

Scopes control what user data your application can access. Claims are the individual pieces of data returned when you call the UserInfo endpoint or decode the ID token. Request only the scopes you need — users see what you are requesting on the consent screen.

Available scopes

Scope Description Claims included
openid Required. Identifies the user sub
profile Basic profile information preferred_username, display_name, picture, created_at
email User's email address email, email_verified
age_verification Whether the user reaches the age band set on your OAuth client age_verified, verified_brackets, meets_threshold
connections Connection details for your site connection (object with connected_at, last_used_at, scopes_granted)

Scope details and examples

openid (required)

This scope is always required. It returns the user's unique Xident ID as the sub claim. This identifier is stable and will not change — use it as the primary key for your user records.

// scope: openid
// Returns the user's unique identifier
{
  "sub": "xid_abc123def456"
}

profile

Returns basic profile information. None of this is PII — usernames and display names are chosen by the user and can be changed. The picture is a Xident-hosted avatar.

// scope: openid profile
// Returns basic profile info
{
  "sub": "xid_abc123def456",
  "preferred_username": "alex_t",
  "display_name": "Alex T.",
  "picture": "https://api.xident.io/avatars/xid_abc123def456.jpg",
  "created_at": "2026-01-10T08:00:00Z"
}

email

Returns the user's email if they have one registered and consent to sharing it. The email_verified claim tells you whether the email has been confirmed.

// scope: openid email
// Returns the user's email (if they have one and consented)
{
  "sub": "xid_abc123def456",
  "email": "[email protected]",
  "email_verified": true
}

age_verification

This is Xident's unique differentiator. No other OAuth provider offers cryptographically verified age information. The age comes only from the date of birth on a government ID that the user verified in the Xident portal, with a liveness check and a face match. It is computed when you ask, and it is not self-reported.

You ask one question: is the user at least your age? When you create or edit your OAuth client in the dashboard and tick Age Verification, you set its Minimum Age, from 12 to 25. Xident checks at the bands 12, 15, 18, 21 and 25, and an age in between is rounded up (19 is stored as 21). A client cannot allow age_verification without a band. The authorization request carries no age: the band comes only from your client's settings, so the user cannot change it, and a min_age in the URL is ignored.

The consent screen shows the band ("Whether you are 18 or older"), and every answer is about that band only: the response includes your band and no separate claim about any other band. To use a different band elsewhere, register a second OAuth client.

// scope: openid age_verification, on an OAuth client whose age band is 18
// One answer about your client's band, from the date of birth on the user's verified government ID
{
  "sub": "xid_abc123def456",
  "age_verified": true,
  "verified_brackets": ["+18"],
  "meets_threshold": { "18": true }
}

// The same request when Xident does not currently prove that the user is 18 or older
{
  "sub": "xid_abc123def456",
  "age_verified": false,
  "meets_threshold": { "18": false }
}
Claim Type Description
age_verified boolean Always present with this scope. true when the date of birth on the user's verified government ID reaches your client's band. false means Xident does not currently prove that band: the user may be under it, or may not have verified a government ID. It does not say which. In the ID token and in UserInfo.
verified_brackets string[] Your band only, for example ["+18"], and only when age_verified is true. Left out otherwise. In the ID token and in UserInfo.
meets_threshold object One key, your band, with the same answer as age_verified, for example {"18": true}. In the ID token and in UserInfo.

The check your site must make

Admit the user when meets_threshold[<your band>] === true. Do not rely on age_verified alone: after you change your client's band, an access token issued before the change still answers truthfully about the old band until it expires.

When you change the band

  • Existing age-verification grants of your client cannot be exchanged or refreshed while their consented band differs from your client's band. The token endpoint answers invalid_grant; send the user through sign-in again, and the consent screen shows the new band. A refused code is spent: it cannot be used again. A refused refresh token's family is revoked, and the API tries to do that every time; if that attempt fails, the token is not revoked, and it can work again once your client's band equals the band it was consented to. When revocation succeeds, setting the band back does not make the family work again.
  • Access tokens already issued keep their original band until they expire (1 hour by default).
  • Your application controls its own login sessions. Xident cannot end them.

Privacy by design

The age_verification scope gives you one answer about the age band you set (for example "18 or older"), not an exact age, a birthdate or a separate answer about any other band (a yes at 21 also tells you the user is 18 or older). No face images, document scans, or personal information are shared. You get a verified pass or fail, nothing more.

connections

Returns metadata about the user's connection to your site. You can only see your own connection — not the user's connections to other sites.

// scope: openid connections
// Returns the user's connected sites (only your site's connection)
{
  "sub": "xid_abc123def456",
  "connection": {
    "connected_at": "2026-02-15T10:30:00Z",
    "last_used_at": "2026-03-10T14:22:00Z",
    "scopes_granted": ["openid", "age_verification", "profile"]
  }
}

Combining scopes

You can request multiple scopes in a single authorization request. Here is an example with all scopes:

// scope: openid profile email age_verification connections
// All scopes combined
{
  "sub": "xid_abc123def456",
  "preferred_username": "alex_t",
  "display_name": "Alex T.",
  "picture": "https://api.xident.io/avatars/xid_abc123def456.jpg",
  "created_at": "2026-01-10T08:00:00Z",
  "email": "[email protected]",
  "email_verified": true,
  "age_verified": true,
  "verified_brackets": ["+18"],
  "meets_threshold": { "18": true },
  "connection": {
    "connected_at": "2026-02-15T10:30:00Z",
    "last_used_at": "2026-03-10T14:22:00Z",
    "scopes_granted": ["openid", "profile", "email", "age_verification", "connections"]
  }
}

Common use case: age-gated content

For most age verification use cases, you only need openid and age_verification. This is the minimal scope set for age-gated content:

// Most common use case: age-gated content
// scope: openid age_verification

const params = new URLSearchParams({
  client_id: 'xc_abc123',
  redirect_uri: 'https://yoursite.com/callback',
  response_type: 'code',
  scope: 'openid age_verification', // Just these two
  code_challenge: codeChallenge,
  code_challenge_method: 'S256',
  state: state,
});

Fetching claims

After obtaining an access token, you can fetch claims from the UserInfo endpoint or decode them from the ID token (if the scope was included in the authorization request).

// Fetch claims from the UserInfo endpoint
const response = await fetch('https://api.xident.io/oauth/userinfo', {
  headers: {
    Authorization: `Bearer ${accessToken}`,
  },
});

const claims = await response.json();

// The age band set on your OAuth client in the dashboard
const BAND = '18';

// Admit the user only on the answer about your band
if (claims.meets_threshold?.[BAND] === true) {
  grantAccess();
} else {
  // Xident does not currently prove this band: the user may be under it,
  // or may not have verified a government ID yet
  showAgeRestrictionMessage();
}

Privacy guarantees

  • No face images — Face data never leaves the user's device during ML verification
  • No documents — Document images are deleted within 24 hours
  • No birthdate shared — You get only the answer about your client's age band
  • No cross-site tracking — Your site cannot see connections to other sites
  • User-controlled — Users can revoke your site's access at any time from their Xident account
  • GDPR-compliant — Hard-delete on account deletion

Next steps