Skip to content

ID tokens

This describes the structure and semantics of the ID token returned by Mosaic upon successful user authentication.

Default claims

Default claims are returned in the ID token without being requested. These claims include standard JWT claims, such as basic user profile data, and info about their authentication.

FieldDescriptionType
subUser's unique identifier (user_id).String
tidID of the Mosaic tenant.String
audClient ID of the application associated with the token request.String
expToken expiration time, as a unix-epoch encoded timestamp in seconds.Number
iatTime the token was issued, as a unix-epoch encoded timestamp in seconds.Number
issToken issuer, which should be: https://userid.security (for global tenants, non EU and CA) or https://eu.userid.security (for EU tenants), https://ca.userid.security (for CA tenants).String
auth_timeTime the user was authenticated, which can be different from the token issue time (if the user was already logged in when the token was requested).Number
amrAuthentication methods used: eml, eotp, sms, pwd,social, webauthn,mfa.Array
acrRequested ACR values that were satisfied, as a space delimited string.String

Custom claims

Aside from the default claims, custom claims can be added to the token by request (see Requesting claims) or included automatically if they were enabled in the ID token - Pre-defined custom claims client configuration (see Manage clients). This includes user roles and permissions, additional user profile data, and custom data set by your application.

The following claims can be requested:

FieldDescriptionType
fnameUser's first name.String
mnameUser's middle name.String
lnameUser's last name.String
webauthnReturned only if WebAuthn was used. Contains info about the devices used, the last time the user logged in, and the first and last time the authenticating device was used.Object
webauthn_usernameReturned only if WebAuthn was used. Contains the username used (UUID) used for WebAuthn.String
new_userIndicates if a new user was created as part of the authentication flow.Boolean
groupsGroups to which the user belongs.Array
rolesList of role IDs assigned to the user.Array
role_valuesList of human-readable main and custom roles assigned to the user.Array
permissionsList of permissions delegated to the user.Array
emailUser's primary email.String
email_verifiedIndicates if the user's primary email is verified.Boolean
phone_numberUser's primary phone number.String
phone_number_verifiedIndicates if the user's primary phone number is verified.Boolean
usernameUsername used to identify the user for password login (unless a primary email will be used instead). Defined only if a password was set for the user.String
secondary_phone_numbersList of user's secondary phone numbers (objects).Array
secondary_emailsList of user's secondary emails (objects).Array
birthdayUser's birthday as YYYY-MM-DD.String
addressUser's address.Object
address_typeType of addressString
street_addressUser's street address.String
cityUser's city of residence.String
countryUser's country of residence.String
pictureThe picture of user, specified as a URL.String
languageThe language of the user, as provided by the browser using the Accept-Language header field.String
created_atDate user was created in the tenant.Number
last_authDate user last authenticated.Number
external_account_idUser identifier in an app, set by the app.String
external_user_idUser identifier in a tenant, set by the app.String
app_nameName of the app the user is associated with.String
custom_dataCustom data object for tenant user info.Object
custom_app_dataCustom data object for app-related user info.Object
custom_group_dataCustom data object for group info.Object
approval_dataReturned only in transaction signing flows. Contains info about transaction type, payment amount, currency, payment method, and payee info.Object
organizationOrganization to which the user belongs.String
Note

For detailed structure of the user profile data, see the User Object returned in the result.

Requesting claims

Additional claims are requested using the claims request parameter, as defined by the OIDC standard. For example, the following claims parameter value is used to request all the user's permissions:

{
   "id_token":{
      "permissions": null
   }
}

Your custom user data can be added to the ID token by requesting the custom_data or custom_app_data claims. If their value is set to null in the request, the entire object will be returned. However, you can also include only a subset of fields in these claims by using a fields member to specify the names of the fields to return as an array.

The following example is used to request 2 fields (named field1 and field2) from the tenant-level custom data and another field (named field3) from the app-level custom data:

{
   "id_token":{
      "custom_data":{
         "fields":[
            "field1",
            "field2"
         ]
      },
      "custom_app_data":{
         "fields":[
            "field3"
         ]
      }
   }
}
Note

The payload of the custom_data or custom_app_data claim cannot exceed 100KB.

Token example

Here's an ID token that includes the user's secondary emails and specific fields from the custom data:

{
  "sub": "ufnbfps4ki0qm1twdo79g",
  "tid": "6oijksdf9esfehwjkfey9",
  "email": "user@acme.com",
  "groups": [],
  "new_user": false,
  "amr": [
    "social"
  ],
  "email_verified": true,
  "secondary_emails": [
    {
      "value": "user@email.com",
      "email_verified": false
    }
  ],
  "custom_data": {
    "field1": "value1",
    "field2": "value2"
  },
  "custom_app_data": {
    "field3": "value3"
  },
  "auth_time": 1674562962,
  "at_hash": "gUWf6OJKHDKUAYDAIX7LQ",
  "aud": "pVEZaxFuQyCQ95NNhiBLe",
  "exp": 1674566580,
  "iat": 1674562980,
  "iss": "https://userid.security"
}