Skip to content

Claims & Scopes

IDToken implements a selective disclosure system that allows relying parties to request only the identity data they need. Users can also choose to grant a subset of the requested scopes.

  1. The relying party registers with specific allowed_scopes
  2. During auth initiation, the RP requests scopes (subset of allowed)
  3. The mobile app can further restrict to grantedScopes
  4. The server builds the JWT with only the granted claims
Registered Serviceallowed_scopes:identity:fullidentity:photoAuth Requestscopes:identity:nameidentity:photoUser DecisiongrantedScopes:identity:nameJWT Claimsidtoken:givenNamefamilyNametrustLevel

These are the individual scopes that map to specific identity claims:

ScopeClaims IncludedSource
identity:namegivenName, familyNameVDS gn, fn
identity:given_namegivenNameVDS gn
identity:family_namefamilyNameVDS fn
identity:date_of_birthdateOfBirthVDS dob
identity:nationalitynationalityVDS nat
identity:documentdocumentNumberVDS doc
identity:photophotoBase64VDS photo
identity:trust_leveltrustLevelEnrollment trust level
identity:age_over_18ageOver18 (boolean)Derived from dob
identity:age_over_21ageOver21 (boolean)Derived from dob
identity:age_over_25ageOver25 (boolean)Derived from dob
identity:age_rangeageRange (bracket)Derived from dob
identity:is_eu_citizenisEuCitizen (boolean)Derived from nat
identity:name_initialnameInitial (e.g., “J. D.”)Derived from gn, fn

Composite scopes expand into multiple atomic scopes for convenience:

Composite ScopeExpands To
identity:basicidentity:name + identity:trust_level
identity:age_verificationidentity:age_over_18 + identity:name
identity:fullidentity:name + identity:date_of_birth + identity:nationality + identity:document + identity:trust_level
identity:full_with_photoidentity:full + identity:photo

Some claims are computed at authentication time from VDS payload data rather than stored directly:

Age is calculated from the dob field using year difference with month/day adjustment:

ClaimComputation
ageOver18currentDate - dob >= 18 years
ageOver21currentDate - dob >= 21 years
ageOver25currentDate - dob >= 25 years
ageRangeBracket: under_18, 18-25, 26-35, 36-50, 51+
ClaimComputation
isEuCitizennationality is in the 27 EU member states list
ClaimComputation
nameInitialFirst letter of given name + ”. ” + First letter of family name + ”.”

The JWT idtoken claim object contains only the fields matching granted scopes:

{
"iss": "https://idtoken.example.com",
"aud": "https://services.example.com",
"sub": "vds-token-id",
"iat": 1705312800,
"exp": 1705316400,
"scope": "identity:name identity:date_of_birth identity:age_over_18",
"idtoken": {
"tokenId": "vds-token-id",
"givenName": "Jean",
"familyName": "Dupont",
"dateOfBirth": "1990-05-15",
"ageOver18": true,
"trustLevel": 3
}
}

Minimal claims example (age verification only)

Section titled “Minimal claims example (age verification only)”
{
"iss": "https://idtoken.example.com",
"aud": "https://services.example.com",
"sub": "vds-token-id",
"iat": 1705312800,
"exp": 1705316400,
"scope": "identity:age_over_18",
"idtoken": {
"tokenId": "vds-token-id",
"ageOver18": true
}
}